anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: aalto-letech/aplus-courses
Issue: Handle errors better when reading exercises

It happened that one exercise had a form field defined as follows in the A+ API
```json
            {
                "key": "field_4",
                "type": null,
                "title": "",
                "required": false
            }
```

That caused our plugin to fail rendering the exercises, because [this line](https://github.com/Aalto-LeTech/aplus-courses/blob/671aca37eaf20d458f164d67c08cc33b216d3188/src/main/java/fi/aalto/cs/apluscourses/model/SubmissionInfo.java#L44)

```java
      String type = spec.getString("type");
```

can't handle null values. (The exception it threw was caught somewhere.)

Fix at least that line! Consider other similar lines there as well.

Changed files:
src/main/java/fi/aalto/cs/apluscourses/model/SubmissionInfo.java

diff --git a/src/main/java/fi/aalto/cs/apluscourses/model/SubmissionInfo.java b/src/main/java/fi/aalto/cs/apluscourses/model/SubmissionInfo.java
index b841841a..da8186c3 100644
--- a/src/main/java/fi/aalto/cs/apluscourses/model/SubmissionInfo.java
+++ b/src/main/java/fi/aalto/cs/apluscourses/model/SubmissionInfo.java
@@ -41,8 +41,8 @@ public class SubmissionInfo {
 
     for (int i = 0; i < formSpec.length(); ++i) {
       JSONObject spec = formSpec.getJSONObject(i);
-      String type = spec.getString("type");
-      if (!type.equals("file")) {
+      String type = spec.optString("type");
+      if (!"file".equals(type)) {
         continue;
       }