bmwinstead / enigma-project

Other
1 stars 1 forks source link

Bug: New GUI Functionality: Pressing Encrypt with no input causes Exception #31

Closed EOhlmacher closed 10 years ago

EOhlmacher commented 10 years ago

Steps to reproduce:

  1. Launch new GUI
  2. Press "Encrypt"
  3. Alternatively, enter only a special character such as $

Observed Result: Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.charAt(Unknown Source) at main.java.GUINew.Lightboard.turnOnLight(Lightboard.java:263) at main.java.GUINew.IOPanel$EncryptButtonListener.actionPerformed(IOPanel.java:231)

Expected Result: No assert. The output text box should read "Input text must contain at least one letter or number." per the EncryptButtonListener class.

EOhlmacher commented 10 years ago

Resolved by checking for empty string in lightboard.