mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-21 20:21:27 +00:00
guard controller from NPE
Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
This commit is contained in:
@@ -41,7 +41,11 @@ public class NotificationController implements FxController {
|
||||
this.notificationsProp = new SimpleListProperty<>(notificationRadar.getEventsRequiringNotification());
|
||||
this.selectionIndex = new SimpleIntegerProperty(0);
|
||||
this.selectedEvent = new SimpleObjectProperty<>();
|
||||
selectionIndex.addListener((_, _, n) -> selectedEvent.setValue(notificationsProp.get(n.intValue())));
|
||||
selectionIndex.addListener((_, _, n) -> {
|
||||
if (! notificationsProp.isEmpty()) {
|
||||
selectedEvent.setValue(notificationsProp.get(n.intValue()));
|
||||
}
|
||||
});
|
||||
selectedEvent.addListener(this::adjustTexts);
|
||||
this.paging = Bindings.createStringBinding(() -> selectionIndex.get() + 1 + "/" + notificationsProp.size(), selectionIndex, notificationsProp);
|
||||
this.message = new SimpleStringProperty();
|
||||
|
||||
Reference in New Issue
Block a user