Skip to content

Commit

Permalink
Fixed potential NPE bug in MenuRunner [25881733]
Browse files Browse the repository at this point in the history
  • Loading branch information
SQUIDwarrior committed Apr 12, 2012
1 parent 709a160 commit 932b735
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/edu/cmu/sv/arinc838/ui/MenuRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ private void runMenu(MenuItem[] menuItems, String header) {

public static int inInt(BufferedReader br) throws Exception {
String inString = br.readLine();
return Integer.valueOf(inString.trim()).intValue();
int value = -1;
if(inString != null) {
value = Integer.valueOf(inString.trim()).intValue();
}

return value;
}

public static void main(String[] args) {
Expand Down

0 comments on commit 932b735

Please sign in to comment.