MCJack123 / craftos2

A fast, modern, and feature-filled ComputerCraft emulator written in C++.
https://www.craftos-pc.cc
Other
240 stars 28 forks source link

Attempting to set an invalid config option results in a crash. #368

Open tehgreatdoge opened 3 months ago

tehgreatdoge commented 3 months ago

Describe the bug If you attempt to set the value of a config option that is nonexistent or not supported by the config.set method, it will result in a crash.

To Reproduce

  1. config.set("thisIsNotARealConfigOption", true) or
  2. config set showMountPrompt false

Expected behavior A lua error will occur and be handleable by the user's code.

Environment (please complete the following information):

Additional context None

MCJack123 commented 3 months ago

https://github.com/MCJack123/craftos2/blob/a85db2b2a502918fbdb1888ff23a64e0c290f361/src/apis/config.cpp#L134-L139

It's probably related to this somehow. No idea why Windows decides to do these things! (For reference, this bug (properly) does not exist on other platforms.)