NuSkooler / enigma-bbs

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

ENIGMA crashes if NUA does not collect complete info. #522

Closed chilledtonic closed 9 months ago

chilledtonic commented 10 months ago

Describe the Bug My understanding was that this pr made collecting full user information unnecessary; however, if you later open the user config page after having some of these values unset (on my board, I do not collect real name or location), and try to tab past an empty line in the config, the board will hard crash with this error.

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

To Reproduce

  1. Establish a board where NUA does not collect name or location (or skip any default field)
  2. Try to edit the account

Expected Behavior

I would prefer either ENIGMA more gracefully handled the empty string.

Actual Behavior

Server crashes completely.

Screenshots If applicable, add screenshots to help explain your problem.

Environment

NuSkooler commented 10 months ago

@chilledtonic thanks for the report & PR! I should be able to take a look this week.

voipmeister commented 9 months ago

Can reproduce on a fresh installation of 0.0.14-beta on a RPi. Going through the application form crashes Enigma on using Tab or Enter. This is the feedback on the console:

/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/nua.js:56:32)
    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 ViewController.switchFocus (/mybbs/enigma-bbs/core/view_controller.js:525:10)
    at ViewController.nextFocus (/mybbs/enigma-bbs/core/view_controller.js:553:14)
    at EditTextView.ViewController.viewActionListener (/mybbs/enigma-bbs/core/view_controller.js:100:22)
    at EditTextView.emit (events.js:400:28)
    at EditTextView.View.onKeyPress (/mybbs/enigma-bbs/core/view.js:310:18)
NuSkooler commented 9 months ago

Thanks for the report - we have a open ticket on this right now. I've been super busy, but I'll try to pull that in today and get it to master.

NuSkooler commented 9 months ago

Just pushed the fixes to this -- note that you will need to change your menu.hjson entries and art files for the NUA and CONF so the fields aren't used!