Skip to content

NoMethodError: undefined method `>' for nil:NilClass

I think this got introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20729

https://sentry.gitlap.com/gitlab/gitlabcom/issues/474184/

NoMethodError: undefined method `>' for nil:NilClass
  deploy_token.rb:31:in `active?'
    !revoked && expires_at > Date.today
  deploy_token.rb:43:in `has_access_to?'
    active? && project == requested_project
  auth/container_registry_authentication_service.rb:156:in `deploy_token_can_pull?'
    current_user.has_access_to?(requested_project) &&
  gitlab/metrics/instrumentation.rb:159:in `block in deploy_token_can_pull?'
    .measure { super }
  gitlab/metrics/method_call.rb:34:in `measure'
    retval = yield
...
(157 additional frame(s) were not displayed)

NoMethodError: undefined method `>' for nil:NilClass