]> Git Server - tankstelle.git/commitdiff
bugfixes
authorRobin Cheney <cheneyr@eternal.ddnss.de>
Wed, 10 Dec 2025 10:55:38 +0000 (11:55 +0100)
committerRobin Cheney <cheneyr@eternal.ddnss.de>
Wed, 10 Dec 2025 10:55:38 +0000 (11:55 +0100)
src/main/java/de/diejungsvondertanke/tankstelle/controllers/NewStationTabController.java
src/main/java/de/diejungsvondertanke/tankstelle/core/Main.java

index a3e012969a83790924e8e2d39166e214865f4950..9b78e7df2766725719526042bf8ae2e984985f33 100644 (file)
@@ -83,8 +83,11 @@ public class NewStationTabController {
 
             } else if (rbLarge.isSelected()) {
                 String company = txtAttr.getText().trim();
-                Main.addNewFuelStation(company);
-                parentController.appendOutput("Added large station (" + company + ").");
+                if (!company.isEmpty()) {
+                    Main.addNewFuelStation(company);
+                    parentController.appendOutput("Added large station (" + company + ").");
+                } else
+                    parentController.showError("Company name must not be empty");
             }
 
             parentController.refreshStationNames();
index 653c83e0836b4d4598e9172a0d103a6bb9560f98..14491f03e1a08fb77c78cfec52545312adacba7c 100644 (file)
@@ -298,9 +298,6 @@ public class Main {
      * @author Leander Schnurrer
      */
     public static void addNewFuelStation(String supermarket_company) {
-        while (supermarket_company.isEmpty()) {
-            // TODO: Show error in UI
-        }
         fuelStations.add(new LargeFuelStation(supermarket_company));
     }
 
@@ -312,9 +309,6 @@ public class Main {
      * @author Leander Schnurrer
      */
     public static void addNewFuelStation(float retail_space) {
-        while (retail_space <= 0) {
-            // TODO: Show error in UI
-        }
         fuelStations.add(new MediumFuelStation(retail_space));
     }
 
@@ -327,9 +321,6 @@ public class Main {
      * @author Leander Schnurrer
      */
     public static void addNewFuelStation(short number_of_vending_machines) {
-        while (number_of_vending_machines <= 0) {
-            // TODO: Show error in UI
-        }
         fuelStations.add(new SmallFuelStation(number_of_vending_machines));
     }