Skip to content

Commit

Permalink
Fixed an NPE when trying to show the popover where no image can be lo…
Browse files Browse the repository at this point in the history
…aded for the location map view.
  • Loading branch information
dlemmermann committed Sep 20, 2023
1 parent 46bcc3c commit 0f19281
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ public EntryMapView(Entry<?> entry) {
mapViewPane.setPrefSize(340, 240);
mapViewPane.setPadding(new Insets(1));
mapViewPane.setStyle("-fx-border-color: gray; -fx-border-radius: 4px;");
mapViewPane.backgroundProperty().bind(Bindings.createObjectBinding(() -> new Background(new BackgroundImage(imageLoader.getValue(), BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, new BackgroundSize(100, 100, true, true, false, true))), imageLoader.valueProperty()));
mapViewPane.backgroundProperty().bind(Bindings.createObjectBinding(() -> {
Image image = imageLoader.getValue();
if (image != null) {
return new Background(new BackgroundImage(image, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, new BackgroundSize(100, 100, true, true, false, true)));
}
return null;
}, imageLoader.valueProperty()));

if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Action.BROWSE)) {
mapViewPane.setCursor(Cursor.HAND);
Expand Down

0 comments on commit 0f19281

Please sign in to comment.