merge NPE bugfix from v0.2
authorEugene Petrenko <eugene.petrenko@gmail.com>
Tue, 19 Jul 2011 15:17:36 +0000 (19:17 +0400)
committerEugene Petrenko <eugene.petrenko@gmail.com>
Tue, 19 Jul 2011 15:17:36 +0000 (19:17 +0400)
nuget-server/src/jetbrains/buildServer/nuget/server/exec/SourcePackageInfo.java
nuget-server/src/jetbrains/buildServer/nuget/server/trigger/NamedPackagesUpdateChecker.java

index 51862e114562c1a0aaf52c8fa65ee0c4ef59bc04..5ab83963b15f38a384c2b1f9a007c7fa1f9d77d7 100644 (file)
@@ -28,6 +28,7 @@ public class SourcePackageInfo {
   private final String myPackageId;\r
   private final String myVersion;\r
 \r
+
   public SourcePackageInfo(@Nullable final String source,\r
                            @NotNull final String packageId,\r
                            @NotNull final String version) {\r
index 110c8146651003bed89599a99647889d8719bdb5..ffbdfe6139b1ea31d5e74705cd17acce04136875 100644 (file)
@@ -66,7 +66,9 @@ public class NamedPackagesUpdateChecker implements TriggerUpdateChecker {
     Collections.sort(sorted, new Comparator<SourcePackageInfo>() {\r
       public int compare(SourcePackageInfo o1, SourcePackageInfo o2) {\r
         int i;\r
-        if (0 != (i = o1.getSource().compareTo(o2.getSource()))) return i;\r
+        String s1 = o1.getSource();\r
+        String s2 = o2.getSource();\r
+        if (s1 != null && s2 != null && 0 != (i = s1.compareTo(s2))) return i;\r
         if (0 != (i = o1.getPackageId().compareTo(o2.getPackageId()))) return i;\r
         if (0 != (i = o1.getVersion().compareTo(o2.getVersion()))) return i;\r
         return 0;\r