[jboss-jira] [JBoss JIRA] Created: (JBPORTAL-2456) NullPointerException copiing the dashboard

Luca Stancapiano (JIRA) jira-events at lists.jboss.org
Mon Sep 14 18:17:23 EDT 2009


NullPointerException copiing the dashboard
------------------------------------------

                 Key: JBPORTAL-2456
                 URL: https://jira.jboss.org/jira/browse/JBPORTAL-2456
             Project: JBoss Portal
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Portal Core
    Affects Versions: 2.7.2 Final
         Environment: JBoss Portal 2.7.2 with AS 4.2.3 and AS 5.0
            Reporter: Luca Stancapiano
            Assignee: Luca Stancapiano
             Fix For: 2.8 Final


here the scenario:

we have:

User          Role
----------------------
User1        User1

User2        User2

Page                                                            Role
----------------------------------------------------------------------------
template                                                       unchecked
template/nuovapagina1                               User1
template/nuovapagina1/altrapagina1          User1
template/nuovapagina1/altrapagina2          User1
template/nuovapagina2                               User2
template/nuovapagina2/naltrapagina1        User2
template/nuovapagina2/naltrapagina2        User2


If I log as User1 in the portal, I obtain a NullPointerException when I try to copy the page template/nuovapagina2 inside dashboard/User1. 

The code is in:

org.jboss.portal.core.impl.model.PageCustomizerInterceptor: 334

the 'from' variable is equals to 'template/nuovapagina1' , the 'to' variable became null because the user hasn't permissions on it. So in the code below we get a NullPointerException and finally the user imports only a piece of template, so the dashboard became iconsistent:

copy(portalObject, to.getChild(portalObject.getName()));

To resolve the problem it is enough the below:

copy(portalObject, to == null ? null : to.getChild(portalObject.getName()));

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list