DFOnline/CodeClient

Crash when using scan on an empty plot

Closed this issue · 1 comments

Describe the bug
If you try to use the scan feature from the API on a plot with no templates, the game crashes.

To Reproduce

  1. Go to an empty plot on DF
  2. Run the 'scan' command through the api, I used the following script:
import websocket
ws = websocket.WebSocket()
ws.connect('ws://localhost:31375')
ws.recv()  # auth
ws.send('scan')
ws.recv()  # received templates (should be nothing)
ws.close()

Expected behavior
The response is an empty string or some other indicator that no templates were found.

Screenshots
Here's the crash report:
https://bytebin.lucko.me/bH1lOkgVdQ

Checks
Please check all these for more infomation with the bug.

  • I am using the latest version.
  • I have tried disabling various options to see if they cause the issue, such as new ones or ones I have recently enabled.

A little late to commit this fix, it should now just respond with empty. (fixed in this commit)