diff options
author | Jonathan Bauer | 2019-03-01 15:02:58 +0100 |
---|---|---|
committer | Jonathan Bauer | 2019-03-01 15:02:58 +0100 |
commit | a0f39f15ad3dc4b71155068899150a6cfc800d0c (patch) | |
tree | 97601e35f9b7b5b41e642184049cff951ff0779d /dozentenmodul | |
parent | [client] formatting (diff) | |
download | tutor-module-a0f39f15ad3dc4b71155068899150a6cfc800d0c.tar.gz tutor-module-a0f39f15ad3dc4b71155068899150a6cfc800d0c.tar.xz tutor-module-a0f39f15ad3dc4b71155068899150a6cfc800d0c.zip |
[client] fix exception when predef netshare has no
mount point
Diffstat (limited to 'dozentenmodul')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java | 9 | ||||
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java index 5a7014d6..8df2540c 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java @@ -92,11 +92,12 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout { tfPassword.setText(item.password); cboNetshareAuth.setSelectedItem(item.auth); if (item.mountpoint != null) { - chkIsPrinter.setSelected(item.mountpoint.equals(PRINTER_MARKER)); - cboNetshareMountPoint - .setSelectedItem(item.mountpoint.equals(PRINTER_MARKER) ? null + boolean isPrinter = item.mountpoint.equals(PRINTER_MARKER); + chkIsPrinter.setSelected(isPrinter); + cboNetshareMountPoint.setSelectedItem(isPrinter ? null + : item.mountpoint.isEmpty() ? EMPTY_MARKER : Character.valueOf(item.mountpoint.charAt(0))); - cboNetshareMountPoint.setEnabled(editable && !item.mountpoint.equals(PRINTER_MARKER)); + cboNetshareMountPoint.setEnabled(editable && !isPrinter); } if (editable) btnAdd.setText("Ă„ndern"); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java index 67191cd9..30994eae 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java @@ -44,6 +44,8 @@ public class NetshareTable extends CheckListTable<NetShare> { return (String) object; if (column == COL_MOUNT) { String input = (String) object; + if (input.isEmpty()) + return String.valueOf(NetshareConfigurator.EMPTY_MARKER); if (!input.equals(String.valueOf(NetshareConfigurator.EMPTY_MARKER)) && !input.equals(NetshareConfigurator.PRINTER_MARKER)) input += ":"; |