Attempt to index a nil value on crop harvest

Some rabbits came to raid the farms but most of the crops (maybe all?) had already been harvested, I was busy directing my archers when the lua error appeared. The rabbits wouldn’t have had time to finish eating the plants, I think the first rabbit had just stopped on a farm tile when the error triggered.

Error:

release-892 (x64)[M]
stonehearth/ai/actions/harvest_crop_adjacent.lua:89: attempt to index a nil value
stack traceback:
stonehearth/ai/actions/harvest_crop_adjacent.lua:89: in function ‘_harvest_one_time’
stonehearth/ai/actions/harvest_crop_adjacent.lua:135: in function <stonehearth/ai/actions/harvest_crop_adjacent.lua:126>
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: in function ‘run’
stonehearth/services/server/tasks/task_action.lua:198: in function <stonehearth/services/server/tasks/task_action.lua:195>
[C]: ?
[C]: ?
[C]: in function ‘run’

[C]: ?
[C]: ?
[C]: ?
[C]: in function ‘run’
stonehearth/components/ai/ai_component.lua:541: in function <stonehearth/components/ai/ai_component.lua:525>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:67: in function ‘xpcall’
stonehearth/components/ai/ai_component.lua:525: in function <stonehearth/components/ai/ai_component.lua:521>
[C]: ?
[C]: ?

Here is the auto save from about 30 seconds before the rabbit raid.
auto_save.7z (5.4 MB)

1 Like

Thank you so much for the savefile, @Lou! :smiley:

1 Like