diff options
| author | Felix Kehrer <felix.kehrer@gmail.com> | 2018-05-07 15:56:33 +0200 | 
|---|---|---|
| committer | Felix Kehrer <felix.kehrer@gmail.com> | 2018-05-07 15:56:33 +0200 | 
| commit | 1243cb27f0239d4dc17fa519a0b0c51881723644 (patch) | |
| tree | a400e236aa7196e91ed57b7d252ee29ca41fb25d /src/main | |
| parent | 126b9a07facec2916156f74b5f632f161df19f11 (diff) | |
| download | sepm-groupproject-1243cb27f0239d4dc17fa519a0b0c51881723644.tar.gz sepm-groupproject-1243cb27f0239d4dc17fa519a0b0c51881723644.tar.xz sepm-groupproject-1243cb27f0239d4dc17fa519a0b0c51881723644.zip  | |
Fix NullPointerException occurring when empty area clicked in table
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/RegistrationWindowController.java | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/RegistrationWindowController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/RegistrationWindowController.java index 152d3f0..0683c77 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/RegistrationWindowController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/RegistrationWindowController.java @@ -109,6 +109,9 @@ public class RegistrationWindowController {                  mouseEvent -> {                      if (mouseEvent.isPrimaryButtonDown() && mouseEvent.getClickCount() == 2) {                          chosenVehicle = tvVehicles.getSelectionModel().getSelectedItem(); +                        if (chosenVehicle == null) { +                            return; +                        }                          lVehicles.setText(chosenVehicle.name());                      }                  }); @@ -116,6 +119,9 @@ public class RegistrationWindowController {                  mouseEvent -> {                      if (mouseEvent.isPrimaryButtonDown() && mouseEvent.getClickCount() == 2) {                          chosenEmployees.add(tvEmployees.getSelectionModel().getSelectedItem()); +                        if (chosenEmployees == null) { +                            return; +                        }                          StringBuilder text = new StringBuilder();                          for (Employee employee : chosenEmployees) {                              text.append(employee.name()).append("\n");  | 
