• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

group management

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
group management administrative code give an error when a user has no group.
Login as admin, select users -> manage groups.
unselect all groups, click submit.

Caused by: java.lang.NullPointerException
at net.jforum.view.admin.UserAction.groupsSave(UserAction.java:277)
because selectedGroups=null

// Associate the user to the selected groups
String[] selectedGroups = this.request.getParameterValues("groups");
HERE ------> int[] newGroups = new int[selectedGroups.length];

for (int i = 0; i < selectedGroups.length; i++) {
newGroups[i] = Integer.parseInt(selectedGroups[i]);
}

[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this fixes the bug:

--- jforum/src/net/jforum/view/admin/UserAction.java.~1.25~ 2005-09-07 15:34:40.000000000 -0400
+++ jforum/src/net/jforum/view/admin/UserAction.java 2005-09-07 15:37:14.000000000 -0400
@@ -274,6 +274,10 @@

// Associate the user to the selected groups
String[] selectedGroups = this.request.getParameterValues("groups");
+ if(selectedGroups == null)
+ {
+ selectedGroups=new String [0];
+ }
int[] newGroups = new int[selectedGroups.length];

for (int i = 0; i < selectedGroups.length; i++) {

[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to open a JIRA issue with the patch attached, so people that come across the same problem know it is solved and Rafael remembers the problem and has your patch located.

He will appreciate it ;).

Thanks!
[originally posted on jforum.net by GreenEyed]
 
Your mother is a hamster and your father smells of tiny ads!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic