Index: applications/editors/josm/plugins/indoorhelper/src/org/openstreetmap/josm/plugins/indoorhelper/IndoorHelperPlugin.java
===================================================================
--- applications/editors/josm/plugins/indoorhelper/src/org/openstreetmap/josm/plugins/indoorhelper/IndoorHelperPlugin.java	(revision 34732)
+++ applications/editors/josm/plugins/indoorhelper/src/org/openstreetmap/josm/plugins/indoorhelper/IndoorHelperPlugin.java	(revision 34733)
@@ -62,10 +62,10 @@
     public IndoorHelperPlugin(PluginInformation info) throws IOException {
         super(info);
+        exportValidator("/data/indoorhelper.validator.mapcss");
+        exportStyleFile("sit.mapcss");
+        exportStyleFile("entrance_door_icon.png");
+        exportStyleFile("entrance_icon.png");
+        exportStyleFile("elevator_icon.png");
         MainApplication.getLayerManager().addAndFireActiveLayerChangeListener(this);
-        this.exportValidator("/data/indoorhelper.validator.mapcss");
-        this.exportStyleFile("sit.mapcss");
-        this.exportStyleFile("entrance_door_icon.png");
-        this.exportStyleFile("entrance_icon.png");
-        this.exportStyleFile("elevator_icon.png");
     }
 
@@ -86,25 +86,20 @@
      */
     private void exportValidator(String resourceName) throws IOException {
-        OutputStream resStreamOut = null;
-
         try (InputStream stream = IndoorHelperPlugin.class.getResourceAsStream(resourceName)) {
             if (stream == null) {
-                System.out.println("Validator: stream is null");
                 throw new IOException("Cannot get resource \"" + resourceName + "\" from Jar file.");
             }
 
-            int readBytes;
-            byte[] buffer = new byte[4096];
-
-            String valDirPath = Config.getDirs().getUserDataDirectory(true) + sep + "validator";
-            File valDir = new File(valDirPath);
+            File valDir = new File(Config.getDirs().getUserDataDirectory(true), "validator");
             valDir.mkdirs();
             String outPath = valDir.getAbsolutePath() +sep+ "indoorhelper.validator.mapcss";
 
-            resStreamOut = new FileOutputStream(outPath);
-            while ((readBytes = stream.read(buffer)) > 0) {
-                resStreamOut.write(buffer, 0, readBytes);
-            }
-            resStreamOut.close();
+            try (OutputStream resStreamOut = new FileOutputStream(outPath)) {
+                int readBytes;
+                byte[] buffer = new byte[4096];
+                while ((readBytes = stream.read(buffer)) > 0) {
+                    resStreamOut.write(buffer, 0, readBytes);
+                }
+            }
         }
     }
@@ -150,17 +145,16 @@
     public void paintableInvalidated(PaintableInvalidationEvent event) {
         AutoFilter currentAutoFilter = AutoFilterManager.getInstance().getCurrentAutoFilter();
-        String currentFilterValue = new String();
 
         if (currentAutoFilter != null) {
-            currentFilterValue = currentAutoFilter.getFilter().text.split("=")[1];
-
-            this.controller.setIndoorLevel(currentFilterValue);
-            this.controller.getIndoorLevel(currentFilterValue);
-            this.controller.unsetSpecificKeyFilter("repeat_on");
-
-        } else {
-            currentFilterValue = "";
-            this.controller.setIndoorLevel(currentFilterValue);
-            this.controller.getIndoorLevel(currentFilterValue);
+            if (controller != null) {
+                String currentFilterValue = currentAutoFilter.getFilter().text.split("=")[1];
+
+                controller.setIndoorLevel(currentFilterValue);
+                controller.getIndoorLevel(currentFilterValue);
+                controller.unsetSpecificKeyFilter("repeat_on");
+            }
+        } else if (controller != null) {
+            controller.setIndoorLevel("");
+            controller.getIndoorLevel("");
         }
     }
