Bug 490 - Array Index out of Bounds
Summary: Array Index out of Bounds
Status: CONFIRMED
Alias: None
Product: Group 15
Classification: Unclassified
Component: Coronavirus Tracker (show other bugs)
Version: 1.0
Hardware: PC Windows
: Normal enhancement
Assignee: YIP Chun Ho
URL:
: 489 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-27 03:54 HKT by YIP Chun Ho
Modified: 2020-12-07 23:37 HKT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description YIP Chun Ho 2020-11-27 03:54:26 HKT
java.lang.StringIndexOutOfBoundsException throws
after input null as patient info
Comment 1 YIP Chun Ho 2020-11-27 03:59:52 HKT
1. Input "c" to create patient
2. Press enter again within input any patient info
3. Exception throws
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
Enter patientID, patientName, gender, status and a list of location visited:
	at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:48)
	at java.base/java.lang.String.charAt(String.java:711)
	at infectionTracker.Command.CreatePatientCommand.execute(CreatePatientCommand.java:45)
	at infectionTracker.Main.main(Main.java:39)
Comment 2 YIP Chun Ho 2020-12-07 23:37:24 HKT
*** Bug 489 has been marked as a duplicate of this bug. ***