raiguard / QuickItemSearch

Factorio mod - quickly search for items in your inventory or connected logistic network.
MIT License
3 stars 0 forks source link

Pressing E when quick item search is empty crashes the game #30

Closed spjoe closed 1 year ago

spjoe commented 2 years ago

Describe the Bug

Pressing E when quick item search result is empty crashes the game. Can be reproduce with a new save file with only quick item search mod installed.

The following stack trace is shown:

Error while running event QuickItemSearch::qis-confirm (ID 266)
QuickItemSearch/scripts/gui/search.lua:407: attempt to index local 'result' (a nil value)
stack traceback:
QuickItemSearch/scripts/gui/search.lua:407: in function 'select_item'
QuickItemSearch/control.lua:75: in function <QuickItemSearch/control.lua:62>"

I guess returning from search_gui.select_item function on line search.lua:374 when result is nil would be a workable fix.

To Reproduce

Steps to reproduce the behavior:

  1. Open the quick search item gui (e.g. with shift+f)
  2. Make sure there are no result entries in the list (e.g. search for "plants")
  3. Click on the title bar of the gui, so that the input box is not active anymore
  4. Press E on the keyboard
  5. See error

Save file & Username

qis-issue.zip Reproduce with a local play, username was spjoe.

Log file

factorio-current.log

raiguard commented 2 years ago

Sourcehut ticket: https://todo.sr.ht/~raiguard/factorio-mods/13

raiguard commented 1 year ago

Was fixed in 00948ec.