Skip to content

Commit 38fa8c5

Browse files
nikit19iamareebjamal
authored andcommitted
fix: App does not crash on bookmarking sessions in TrackSessionActivity (fossasia#2279)
1 parent 5057bb5 commit 38fa8c5

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

android/app/src/main/java/org/fossasia/openevent/core/track/session/TrackSessionsActivity.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,17 @@ public void setUpcomingSession() {
188188
String color = null;
189189
ZonedDateTime current = ZonedDateTime.now();
190190
for (Session session : sessions) {
191-
ZonedDateTime start = DateConverter.getDate(session.getStartsAt());
192-
if (start.isAfter(current)) {
193-
upcomingTitle = session.getTitle();
194-
track = session.getTrack().getName();
195-
color = session.getTrack().getColor();
196-
break;
191+
if (session.getStartDate() != null) {
192+
ZonedDateTime start = DateConverter.getDate(session.getStartsAt());
193+
if (start.isAfter(current)) {
194+
if (session.getTitle() != null)
195+
upcomingTitle = session.getTitle();
196+
if (session.getTrack().getName() != null)
197+
track = session.getTrack().getName();
198+
if (session.getTrack().getColor() != null)
199+
color = session.getTrack().getColor();
200+
break;
201+
}
197202
}
198203
}
199204

0 commit comments

Comments
 (0)