Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic