koushikkothagal/coronavirus-tracker

Error: java.lang.NumberFormatException

ruhuang2001 opened this issue · 0 comments

CoronaVirusDataService.java code:

45        int latestCases = Integer.parseInt(record.get(record.size() - 1));
46        int prevDayCases = Integer.parseInt(record.get(record.size() - 2));
47        locationStat.setLatestTotalCases(latestCases);
48        locationStat.setDiffFromPrevDay(latestCases - prevDayCases);

Integer.parseInt(string) will throw the Error: java.lang.NumberFormatException if the string is empty.