[
https://jira.jboss.org/jira/browse/GTNPORTAL-1009?page=com.atlassian.jira...
]
Matt Wringe commented on GTNPORTAL-1009:
----------------------------------------
Technically it doesn't cause any problems with the way its used right now. But it
should be checking if its null first, it could cause problems in the future if the code
that uses it changes.
Its only being used from UIPageBody.getUIPage(...):
if(page == null)
{
//Clear the UIPage from cache in UIPortal
uiPortal.clearUIPage(pageReference); <--- throws NPE
throw new Exception("The page with id " + pageReference + " has
been removed");
}
So what is happening here, is that the clearUIPage will throw an NPE, but it was going to
throw an exception afterwards anyway. The code which calls this is listening for an
Exception and will get the NPE instead of the specified Exception.
We don't even get the wrong error message in the logs since what is catching this
isn't logging anything (logging the exception is marked as todo).
UIPortal NPE on clearUIPages
----------------------------
Key: GTNPORTAL-1009
URL:
https://jira.jboss.org/jira/browse/GTNPORTAL-1009
Project: GateIn Portal
Issue Type: Bug
Security Level: Public(Everyone can see)
Reporter: Matt Wringe
Attachments: UIPortal_clear_NPE.patch
A NPE can occur during clearUIPages since we don't check if all_UIPages exists before
trying to remove elements.
--
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