]> source.dussan.org Git - gitblit.git/commitdiff
Fixed null pointer exceptions Manager create User and Team
authorJames Moger <james.moger@gitblit.com>
Mon, 22 Oct 2012 20:16:57 +0000 (16:16 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 22 Oct 2012 20:16:57 +0000 (16:16 -0400)
src/com/gitblit/client/EditTeamDialog.java
src/com/gitblit/client/EditUserDialog.java

index 4eb07295055fe53773941d3e11dd30a0f8cd8540..81146fc6b231aa10dbd0622caee4b8a66b30100c 100644 (file)
@@ -49,6 +49,7 @@ import com.gitblit.models.RegistrantAccessPermission;
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.ServerSettings;\r
 import com.gitblit.models.TeamModel;\r
+import com.gitblit.utils.ArrayUtils;\r
 import com.gitblit.utils.StringUtils;\r
 \r
 public class EditTeamDialog extends JDialog {\r
@@ -316,8 +317,12 @@ public class EditTeamDialog extends JDialog {
                }\r
                \r
                // remove repositories for which team already has a permission\r
-               for (RegistrantAccessPermission rp : permissions) {\r
-                       restricted.remove(rp.registrant);\r
+               if (permissions == null) {\r
+                       permissions = new ArrayList<RegistrantAccessPermission>();\r
+               } else {\r
+                       for (RegistrantAccessPermission rp : permissions) {\r
+                               restricted.remove(rp.registrant);\r
+                       }\r
                }\r
 \r
                StringUtils.sortRepositorynames(restricted);\r
index 5b789da57df935cf52c7ac424a007455d564eb7d..da75867fb328a227e41e3440b701abdd085267e9 100644 (file)
@@ -347,9 +347,14 @@ public class EditUserDialog extends JDialog {
                                restricted.add(repo.name);\r
                        }\r
                }\r
+\r
                // remove repositories for which user already has a permission\r
-               for (RegistrantAccessPermission rp : permissions) {\r
-                       restricted.remove(rp.registrant);\r
+               if (permissions == null) {\r
+                       permissions = new ArrayList<RegistrantAccessPermission>();\r
+               } else {\r
+                       for (RegistrantAccessPermission rp : permissions) {\r
+                               restricted.remove(rp.registrant);\r
+                       }\r
                }\r
                \r
                StringUtils.sortRepositorynames(restricted);\r