Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

[dor_indexing_app/production] NoMethodError: undefined method `[]' for nil:NilClass #138

Closed
drh-stanford opened this issue Mar 9, 2017 · 2 comments

Comments

@drh-stanford
Copy link

Backtrace

line 3 of [PROJECT_ROOT]/app/controllers/dor_controller.rb: reindex

View full backtrace and more info at honeybadger.io

@jcoyne jcoyne reopened this Nov 15, 2018
jcoyne added a commit that referenced this issue Nov 15, 2018
This should prevent a nil pointer error #138
which is guarded against in sul-dlss-deprecated/dor-services#367
@jcoyne
Copy link
Contributor

jcoyne commented Nov 16, 2018

Here's a minimal reproduction:

obj = Dor.load_instance 'druid:st562rd3260'
 => #<Dor::Item pid: "druid:st562rd3260", admin_policy_object_id: "druid:yn891tj4781">
obj.workflows.to_solr
Traceback (most recent call last):
        1: from (irb):5
NoMethodError (undefined method `[]' for nil:NilClass)

@jcoyne
Copy link
Contributor

jcoyne commented Nov 16, 2018

> obj.workflows.workflows.count
 => 7
> obj.workflows.workflows[3].workflowId
 => ["dpgImageWF"]
> dpgImageWF = obj.workflows.workflows[3]
 => #<Dor::Workflow::Document:31478820>
> dpgImageWF.processes.count
 => 12
> dpgImageWF.processes[0].state
 => "completed"
 > dpgImageWF.processes[1].state
Traceback (most recent call last):
        1: from (irb):29
NoMethodError (undefined method `[]' for nil:NilClass)
> dpgImageWF.processes[1]
 => #<Dor::Workflow::Process:0x00000000071f8f40 @workflow="dpgImageWF", @repo="dor", @attrs={"name"=>"tracking_db", "sequence"=>2, "status"=>"waiting", "lifecycle"=>nil, "label"=>"Add to DPG tracking database", "batch_limit"=>nil, "error_limit"=>nil, "priority"=>0, "prerequisite"=>["initiate"]}>
 > dpgImageWF.processes[1].state
Traceback (most recent call last):
        1: from (irb):31
NoMethodError (undefined method `[]' for nil:NilClass)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants