Salome HOME
Refactoring continues: UserService is created instead of UserDirectory. Database...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / ApplicationSettings.java
index 0707ca507f6d00cf31b3ac49e3a68780bb90195f..ed1df7ae9690ee92c19b607b2a6ec925d6e5ba21 100644 (file)
@@ -537,6 +537,9 @@ public class ApplicationSettings {
 
        public static ApplicationSettings getMe() {
                // ------------------------------------------
+               if (my == null) {
+                       my = new ApplicationSettings();
+               }
                return my; // The application is supposed being previously created below
        }
 
@@ -560,8 +563,12 @@ public class ApplicationSettings {
 
                logger.info("Application root set to "
                                + wapprops.getProperty("wapp.root"));
-               my = this;
-               return this;
+               if (my == null) {
+                       my = this;
+               }
+//RKV          my = this;
+//RKV          return this;
+               return my;
        }
 
        // ==============================================================================================================================
@@ -655,8 +662,12 @@ public class ApplicationSettings {
                                module.add(command);
                                String[] parsed = command.split("/");
                                String[] name = parsed[parsed.length - 1].split("\\x2E");
-                               String docname = my.defdoctype.get(
-                                               step.getNumber() + "." + format).getName();
+                               DocumentType dtype = my.defdoctype.get(
+                                               step.getNumber() + "." + format);
+                               String docname = "";
+                               if (dtype != null) {
+                                       docname = dtype.getName();
+                               }
                                if (tempfile.get(docname) == null) { // No available template
                                        String tool = parsed[parsed.length - 1];
                                        String icon = name[0];