From c2fa31aa9f5c27f6881da11f1f77e14474e75bd1 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Thu, 4 Dec 2025 22:13:22 +0100 Subject: [PATCH] fix: no null pointer exceptions if the user can't see anything :) --- client/src/main/java/client/scenes/FoodpalApplicationCtrl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java b/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java index cf5dc49..a182619 100644 --- a/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java +++ b/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java @@ -203,8 +203,8 @@ public class FoodpalApplicationCtrl implements LocaleAware { // Select first recipe in the list by default if (!recipes.isEmpty()) { recipeList.getSelectionModel().selectFirst(); - detailsScreen.visibleProperty().set(true); } + detailsScreen.visibleProperty().set(!recipes.isEmpty()); } private void printError(String msg) { Alert alert = new Alert(Alert.AlertType.ERROR);