Skip to content

Commit 63ecd1c

Browse files
authored
fix(android): make LocalNotification not crash on showing when (#2677)
1 parent 2185833 commit 63ecd1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

android/capacitor/src/main/java/com/getcapacitor/plugin/notification/LocalNotificationManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ private void buildNotification(NotificationManagerCompat notificationManager, Lo
176176
}
177177

178178
// make sure scheduled time is shown instead of display time
179-
if (localNotification.isScheduled()) {
179+
if (localNotification.isScheduled() && localNotification.getSchedule().getAt() != null) {
180180
mBuilder.setWhen(localNotification.getSchedule().getAt().getTime())
181-
.setShowWhen(true);
181+
.setShowWhen(true);
182182
}
183183

184184
mBuilder.setVisibility(NotificationCompat.VISIBILITY_PRIVATE);

0 commit comments

Comments
 (0)