tyoeer / Chaoshead

A level editor, scripting interface, campaign editor, and reverse engineering tool for Levelhead
Apache License 2.0
4 stars 1 forks source link

Chaoshead crashes on launch if the save_data folder on any profile is empty or does not contain what it should #115

Closed slothybutt closed 1 year ago

slothybutt commented 1 year ago

Steps to reproduce: Relocate one profile's save_data folder somewhere else, make a new save_data folder that is either empty or has some random text in it.

Chaoshead will crash when it tries to open, with this error:

Error

libs/json.lua:377: expected argument of type string, got nil

Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'error'
libs/json.lua:377: in function 'decode'
levelhead/dataFile.lua:12: in function 'initialize'
levelhead/userData/class.lua:5: in function 'initialize'
libs/middleclass.lua:139: in function 'getUserData'
levelEditor/workshop/levelSelector.lua:20: in function 'findLastEditedLevel'
levelEditor/workshop/levelSelector.lua:51: in function 'getRootEntries'
ui/tools/treeList.lua:35: in function 'initialize'
libs/middleclass.lua:139: in function 'new'
...
levelEditor/workshop/workshop.lua:11: in function 'initialize'
libs/middleclass.lua:139: in function 'new'
chaoshead/chaoshead.lua:17: in function 'initialize'
libs/middleclass.lua:139: in function 'new'
main.lua:60: in function 'load'
[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
[C]: in function 'xpcall'
[C]: in function 'xpcall'