Add a null check because calling getRealPath() in WebLogic servers will produce null with requests that contain '../'. These result in NullPointerExceptions that print stack traces out to the browser.