Skip to content

Commit

Permalink
FIX: null assignments[]
Browse files Browse the repository at this point in the history
  • Loading branch information
bubblepipe committed Sep 2, 2018
1 parent a848935 commit 93e8fb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SchoolPower/Models/Subject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ public Subject(JObject data) {
SmallTextFontWeight = FontWeights.Normal;
IsActive = GetActivity(StartDate, EndDate);

JArray assignmentsJarray = (JArray)data["assignments"];
JArray assignmentsJarray = new JArray();
try {
assignmentsJarray = (JArray)data["assignments"];
} catch (Exception) { }
try {
for (int index = 0; index < assignmentsJarray.Count; index++)
Assignments.Add(new AssignmentItem((JObject)assignmentsJarray[index]));
Expand Down

0 comments on commit 93e8fb5

Please sign in to comment.