Fix NullPointerException

This commit is contained in:
TebbeUbben 2020-03-09 23:11:14 +01:00
parent 7d9c1f8af9
commit 5e778f1e76

View file

@ -237,7 +237,7 @@ public class InsightAlertService extends Service implements InsightConnectionSer
stopAlerting(); stopAlerting();
showNotification(alert); showNotification(alert);
SnoozeAlertMessage snoozeAlertMessage = new SnoozeAlertMessage(); SnoozeAlertMessage snoozeAlertMessage = new SnoozeAlertMessage();
snoozeAlertMessage.setAlertID(alertLiveData.getValue().getAlertId()); snoozeAlertMessage.setAlertID(alert.getAlertId());
connectionService.requestMessage(snoozeAlertMessage).await(); connectionService.requestMessage(snoozeAlertMessage).await();
} }
} catch (AppLayerErrorException e) { } catch (AppLayerErrorException e) {
@ -262,7 +262,7 @@ public class InsightAlertService extends Service implements InsightConnectionSer
alertLiveData.postValue(null); alertLiveData.postValue(null);
dismissNotification(); dismissNotification();
ConfirmAlertMessage confirmAlertMessage = new ConfirmAlertMessage(); ConfirmAlertMessage confirmAlertMessage = new ConfirmAlertMessage();
confirmAlertMessage.setAlertID(alertLiveData.getValue().getAlertId()); confirmAlertMessage.setAlertID(alert.getAlertId());
connectionService.requestMessage(confirmAlertMessage).await(); connectionService.requestMessage(confirmAlertMessage).await();
this.alert = null; this.alert = null;
} }