Author: thn
Date: 2008-11-16 06:48:53-0800
New Revision: 16056

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java

Log:
applying (part of) Christians patch (for NPE safeness)

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java?view=diff&rev=16056&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java&r1=16055&r2=16056
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java        
(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java        
2008-11-16 06:48:53-0800
@@ -234,8 +234,12 @@
             addSourceEncoding(general);
 
             tab.add(general, Translator.localize("action.import-general"));
-            tab.add(getConfigPanelExtension(),
-                    ((ModuleInterface) getCurrentModule()).getName());
+
+            ImportInterface current = getCurrentModule();
+            if (current != null) {
+                tab.add(getConfigPanelExtension(),
+                        current.getName());            
+            }
             configPanel = tab;
         }
         return configPanel;
@@ -366,7 +370,11 @@
      * Get the extension panel for the configuration settings.
      */
     private JComponent getConfigPanelExtension() {
-        List<Setting> settings = getCurrentModule().getImportSettings();
+        List<Setting> settings = null;
+        ImportInterface current = getCurrentModule();
+        if (current != null) {
+            settings = current.getImportSettings();
+        }
         return  new ConfigPanelExtension(settings);
     }
 
@@ -504,8 +512,11 @@
         final JFileChooser chooser = new ImportFileChooser(this, directory);
 
         chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
-        updateFilters(chooser, null, getCurrentModule().getSuffixFilters());
+        ImportInterface current = getCurrentModule();
 
+        if (current != null) {
+            updateFilters(chooser, null, current.getSuffixFilters());
+        }
         return chooser;
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to