Skip to content

Commit

Permalink
Fix BadParcelableException while loading assignment view
Browse files Browse the repository at this point in the history
  • Loading branch information
therealsujitk committed Nov 13, 2023
1 parent 8feadbf commit 78df47e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ protected Assignment(Parcel in) {
dueDate = in.readLong();
cutoffDate = in.readLong();

if (dueDate == 0) dueDate = null;
if (cutoffDate == 0) cutoffDate = null;

introAttachments = new ArrayList<>();
in.readList(introAttachments, Attachment.class.getClassLoader());
}
Expand All @@ -67,8 +70,13 @@ public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(course);
parcel.writeString(title);
parcel.writeString(intro);

if (dueDate != null) parcel.writeLong(dueDate);
else parcel.writeLong(0);

if (cutoffDate != null) parcel.writeLong(cutoffDate);
else parcel.writeLong(0);

parcel.writeList(introAttachments);
}
}

0 comments on commit 78df47e

Please sign in to comment.