From a3345f4c53c0c06bca98a8c0a202c0a1f6271876 Mon Sep 17 00:00:00 2001 From: jeb228 Date: Mon, 7 Feb 2011 17:47:22 +0000 Subject: [PATCH] Prevent a NullPointerException from a null request, by making that test first. --- .../src/edu/cornell/mannlib/vitro/webapp/web/TabWebUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/TabWebUtil.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/TabWebUtil.java index 0e3253aed..0ec2e545e 100755 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/TabWebUtil.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/TabWebUtil.java @@ -170,12 +170,12 @@ public class TabWebUtil { */ public static Tab findStashedTab( String tabId, HttpServletRequest request) throws JspException{ + if( request == null ) + throw new JspException("findStashedTab: request was null"); if( request.getAttribute(STASHED_KEY) == null ) throw new JspException("findStashedTab: called before stashTabsInRequest."); if( tabId == null) throw new JspException("findStashedTab: tabId was null"); - if( request == null ) - throw new JspException("findStashedTab: request was null"); Object obj = request.getAttribute("tab"+tabId); if( obj == null ) throw new JspException("findStashedTab: tab"+tabId+" not found in vitro request");