Skip to content

Refactored test file code and fixed error.

The following error occurs when the MOTD test file is unavailable:

Main error: Data/Scripts/UI/StartMenu.lua:159: attempt to index local 'f' (a nil value) appVersion: Unofficial Version 1.07 appBuild: 1 StackTrace: stack traceback: Data/Scripts/ErrorReporting.lua:28: in function <Data/Scripts/ErrorReporting.lua:20> [C]: in function '__index' Data/Scripts/UI/StartMenu.lua:159: in function 'onMOTDTaskFinished' Data/Scripts/UI/StartMenu.lua:24: in function <Data/Scripts/UI/StartMenu.lua:24> Error Type: lua

While investigating this error, I noticed two identical sections of code which retrieved the MOTD test file.

I refactored the code to have only one section of code retrieve the file, and I checked the error condition from opening the test file. When the test file is not found, the code returns a null string.

Merge request reports