NumberFormatException

This commit is contained in:
Caesar2011
2019-02-08 08:56:19 +01:00
parent 261878b6e3
commit e8c3ca0b0e

View File

@@ -300,7 +300,7 @@ public class ModulesList extends HTTPService {
HashSet<String> lvNumberSet = new HashSet<>(); HashSet<String> lvNumberSet = new HashSet<>();
boolean found = false; boolean found = false;
try { try {
Matcher match = Regex.match("[A-Za-z0-9]*_([A-Za-z0-9]*)_([A-Za-z0-9]*)_([0-9]*)([A-Z]*)", json.getString("courseId")); Matcher match = Regex.match("[A-Za-z0-9]*_([A-Za-z0-9]*)_([A-Za-z0-9]*)_([0-9]{2}[0-9]{2}?)([WS]+)", json.getString("courseId"));
type = match.group(1); type = match.group(1);
lvNumber = match.group(2); lvNumber = match.group(2);
semYear = match.group(3); semYear = match.group(3);
@@ -313,7 +313,7 @@ public class ModulesList extends HTTPService {
break; break;
} }
} }
} catch (NoSuchFieldException e) { } catch (NoSuchFieldException | NumberFormatException e) {
type = "Projekt"; type = "Projekt";
} }
if (!found) { if (!found) {