This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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]
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic