trunk@7626 backported
authorAlex Kirhenshtein <alk@netxms.org>
Sun, 25 Aug 2013 08:45:21 +0000 (08:45 +0000)
committerAlex Kirhenshtein <alk@netxms.org>
Sun, 25 Aug 2013 08:45:21 +0000 (08:45 +0000)
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/views/helpers/DciComparator.java

index 1c23299..b7e2d81 100644 (file)
@@ -75,7 +75,29 @@ public class DciComparator extends ViewerComparator
                        case DataCollectionEditor.COLUMN_TEMPLATE:\r
                                final String text1 = labelProvider.getColumnText(e1, column);\r
                                final String text2 = labelProvider.getColumnText(e2, column);\r
-                               result = text1.compareToIgnoreCase(text2);\r
+\r
+                               if (text1 != null && text2 != null)\r
+                               {\r
+                                       result = text1.compareToIgnoreCase(text2);\r
+                               }\r
+                               else\r
+                               {\r
+                                       if (text1 == null)\r
+                                       {\r
+                                               if (text2 == null)\r
+                                               {\r
+                                                       result = 0;\r
+                                               }\r
+                                               else\r
+                                               {\r
+                                                       result = -1;\r
+                                               }\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               result = 1;\r
+                                       }\r
+                               }\r
                                break;\r
                        default:\r
                                result = 0;\r