svn commit: r12535 - trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-05-04 11:54:14-0700
New Revision: 12535

Modified:
   trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java

Log:
Protect shortcuts action comparator against null action names

Modified: trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java?view=diff&rev=12535&p1=trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java&p2=trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java&r1=12534&r2=12535
==============================================================================
--- trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java	(original)
+++ trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java	2007-05-04 11:54:14-0700
@@ -347,8 +347,15 @@
                 new Action[shortcutHash.size()]);
         Arrays.sort(actions, new Comparator() {
             public int compare(Object o1, Object o2) {
-                return ((Action) o1).getActionName().compareTo(((Action) o2)
-                                                            .getActionName());
+                String name1 = ((Action) o1).getActionName();
+                if (name1 == null) {
+                    name1 = "";
+                }
+                String name2 = ((Action) o2).getActionName();
+                if (name2 == null) {
+                    name2 = "";
+                }
+                return name1.compareTo(name2);
             }
         });
         return actions;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.