NuSkooler / enigma-bbs

ENiGMA½ BBS Software
https://nuskooler.github.io/enigma-bbs/
BSD 2-Clause "Simplified" License
529 stars 104 forks source link

Empty subject in new mail throws "Cannot read property 'toString' of undefined" #528

Closed voipmeister closed 6 months ago

voipmeister commented 6 months ago

Describe the Bug When posting a new message and omitting the subject, Engima crashes with TypeError: Cannot read property 'toString' of undefined

To Reproduce Post a new message, leave the subject empty (just skip over it with 'Enter').

Expected Behavior User should be warned about not being able to send a message without a subject.

Actual Behavior Enigma crashes with the error below:

/mybbs/enigma-bbs/core/text_view.js:156
        text = text.toString();
                    ^

TypeError: Cannot read property 'toString' of undefined
    at TextView.setText (/mybbs/enigma-bbs/core/text_view.js:156:21)
    at viewValidationListener (/mybbs/enigma-bbs/core/fse.js:171:40)
    at validateResult (/mybbs/enigma-bbs/core/view_controller.js:395:21)
    at EditTextView.validateNonEmpty [as validate] (/mybbs/enigma-bbs/core/system_view_validate.js:27:12)
    at ViewController.validateView (/mybbs/enigma-bbs/core/view_controller.js:387:18)
    at EditTextView.ViewController.viewActionListener (/mybbs/enigma-bbs/core/view_controller.js:107:26)
    at EditTextView.emit (events.js:400:28)
    at EditTextView.View.onKeyPress (/mybbs/enigma-bbs/core/view.js:308:18)
    at EditTextView.onKeyPress (/mybbs/enigma-bbs/core/edit_text_view.js:100:46)
    at TelnetClient.ViewController.clientKeyPressHandler (/mybbs/enigma-bbs/core/view_controller.js:91:34)

Screenshots Not really applicable.

Environment

NuSkooler commented 6 months ago

This was fixed sometime last week: https://github.com/NuSkooler/enigma-bbs/blob/master/core/text_view.js#L154 (https://github.com/NuSkooler/enigma-bbs/commit/223b7b2ed622017c0c1da4cc974966c60aeb7bc4)

Can you try pulling?

cd /path/to/enigma-bbs
git pull
# restart your board
voipmeister commented 6 months ago

Works, thanks!