Skip to main content

NoMethodError: undefined method `public_token' for nil (NoMethodError)

Sentry Issue: EVALMEE-3H8

NoMethodError: undefined method `public_token' for nil (NoMethodError)

        link(:exam_session) { |r, obj| r.api_public_v2_exam_exam_session_url(obj.quiz.uuid, obj.session.public_token) }
                                                                                                       ^^^^^^^^^^^^^
    from app/blueprints/api/public/v2/exam_attempt_blueprint.rb:42:in 'block in <class:ExamAttemptBlueprint>'
    from app/blueprints/api/public/v2/base_blueprint.rb:32:in 'block (2 levels) in has_links'
    from app/blueprints/api/public/v2/base_blueprint.rb:31:in 'each'
    from app/blueprints/api/public/v2/base_blueprint.rb:31:in 'each_with_object'
    from app/blueprints/api/public/v2/base_blueprint.rb:31:in 'block in has_links'
    from blueprinter/extractors/block_extractor.rb:9:in 'extract'
    from blueprinter/extractors/auto_extractor.rb:23:in 'extract'
    from blueprinter/field.rb:17:in 'extract'
    from blueprinter/helpers/base_helpers.rb:64:in 'block in object_to_hash'
    from blueprinter/helpers/base_helpers.rb:61:in 'each'
    from blueprinter/helpers/base_helpers.rb:61:in 'each_with_object'
    from blueprinter/helpers/base_helpers.rb:61:in 'object_to_hash'
    from blueprinter/helpers/base_helpers.rb:38:in 'block in prepare_data'
    from blueprinter/helpers/base_helpers.rb:37:in 'map'
    from blueprinter/helpers/base_helpers.rb:37:in 'prepare_data'
    from blueprinter/base.rb:256:in 'prepare'
    from blueprinter/helpers/base_helpers.rb:22:in 'prepare_for_render'
    from blueprinter/base.rb:217:in 'render_as_hash'
    from app/models/public/paginated_collection.rb:71:in 'render_as_hash'
    from blueprinter/extractors/public_send_extractor.rb:9:in 'public_send'
    from blueprinter/extractors/public_send_extractor.rb:9:in 'extract'
    from blueprinter/extractors/auto_extractor.rb:23:in 'extract'
    from blueprinter/field.rb:17:in 'extract'
    from blueprinter/helpers/base_helpers.rb:64:in 'block in object_to_hash'
    from blueprinter/helpers/base_helpers.rb:61:in 'each'
    from blueprinter/helpers/base_helpers.rb:61:in 'each_with_object'
    from blueprinter/helpers/base_helpers.rb:61:in 'object_to_hash'
    from blueprinter/helpers/base_helpers.rb:43:in 'prepare_data'
    from blueprinter/base.rb:256:in 'prepare'
    from blueprinter/extractors/association_extractor.rb:24:in 'extract'
    from blueprinter/field.rb:17:in 'extract'
    from blueprinter/helpers/base_helpers.rb:64:in 'block in object_to_hash'
    from blueprinter/helpers/base_helpers.rb:61:in 'each'
    from blueprinter/helpers/base_helpers.rb:61:in 'each_with_object'
    from blueprinter/helpers/base_helpers.rb:61:in 'object_to_hash'
    from blueprinter/helpers/base_helpers.rb:38:in 'block in prepare_data'
    from active_record/relation/delegation.rb:100:in 'each'
    from active_record/relation/delegation.rb:100:in 'each'
    from blueprinter/helpers/base_helpers.rb:37:in 'map'
    from blueprinter/helpers/base_helpers.rb:37:in 'prepare_data'
    from blueprinter/base.rb:256:in 'prepare'
    from blueprinter/helpers/base_helpers.rb:22:in 'prepare_for_render'
    from blueprinter/base.rb:217:in 'render_as_hash'
    from app/models/public/paginated_collection.rb:71:in 'render_as_hash'
    from blueprinter/extractors/public_send_extractor.rb:9:in 'public_send'
    from blueprinter/extractors/public_send_extractor.rb:9:in 'extract'
    from blueprinter/extractors/auto_extractor.rb:23:in 'extract'
    from blueprinter/field.rb:17:in 'extract'
    from blueprinter/helpers/base_helpers.rb:64:in 'block in object_to_hash'
    from blueprinter/helpers/base_helpers.rb:61:in 'each'
    from blueprinter/helpers/base_helpers.rb:61:in 'each_with_object'
    from blueprinter/helpers/base_helpers.rb:61:in 'object_to_hash'
    from blueprinter/helpers/base_helpers.rb:43:in 'prepare_data'
    from blueprinter/base.rb:256:in 'prepare'
    from blueprinter/helpers/base_helpers.rb:22:in 'prepare_for_render'
    from blueprinter/base.rb:192:in 'render'
    from app/controllers/api/public/v2/base_controller.rb:98:in 'render_index'
    from app/controllers/api/public/v2/exam_results_controller.rb:41:in 'index'
    from action_controller/metal/basic_implicit_render.rb:6:in 'send_action'
    from abstract_controller/base.rb:224:in 'process_action'
    from scout_apm/instruments/action_controller_rails_3_rails4.rb:103:in 'process_action'
    from action_controller/metal/rendering.rb:165:in 'process_action'
    from abstract_controller/callbacks.rb:259:in 'block in process_action'
    from active_support/callbacks.rb:121:in 'block in run_callbacks'
    from app/services/audit/current_context.rb:167:in 'with_auditable'
    from app/controllers/concerns/api/public/audit_context.rb:35:in 'block (2 levels) in with_audit_context'
    from app/services/audit/current_context.rb:251:in 'with_intermediary'
    from app/cont...
Status: Completed

Log in to comment and vote

No comments yet

Be the first to share your thoughts.