Prevent a NullPointerException from a null request, by making that test first.
This commit is contained in:
parent
2903d0c20d
commit
a3345f4c53
1 changed files with 2 additions and 2 deletions
|
@ -170,12 +170,12 @@ public class TabWebUtil {
|
||||||
*/
|
*/
|
||||||
public static Tab findStashedTab( String tabId, HttpServletRequest request)
|
public static Tab findStashedTab( String tabId, HttpServletRequest request)
|
||||||
throws JspException{
|
throws JspException{
|
||||||
|
if( request == null )
|
||||||
|
throw new JspException("findStashedTab: request was null");
|
||||||
if( request.getAttribute(STASHED_KEY) == null )
|
if( request.getAttribute(STASHED_KEY) == null )
|
||||||
throw new JspException("findStashedTab: called before stashTabsInRequest.");
|
throw new JspException("findStashedTab: called before stashTabsInRequest.");
|
||||||
if( tabId == null)
|
if( tabId == null)
|
||||||
throw new JspException("findStashedTab: tabId was null");
|
throw new JspException("findStashedTab: tabId was null");
|
||||||
if( request == null )
|
|
||||||
throw new JspException("findStashedTab: request was null");
|
|
||||||
Object obj = request.getAttribute("tab"+tabId);
|
Object obj = request.getAttribute("tab"+tabId);
|
||||||
if( obj == null )
|
if( obj == null )
|
||||||
throw new JspException("findStashedTab: tab"+tabId+" not found in vitro request");
|
throw new JspException("findStashedTab: tab"+tabId+" not found in vitro request");
|
||||||
|
|
Loading…
Add table
Reference in a new issue