Source:
<code>protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { Integer itemID = UIUtil.getIntParameter(request, "itemID"); String versionID = request.getParameter("versionID"); Item item = Item.find(context, itemID); <START> if (item == null <END> || !AuthorizeManager.isAdmin(context, item.getOwningCollection())) { if (new DSpace().getConfigurationService().getPropertyAsType( "versioning.item.history.view.admin", true)) { throw new AuthorizeException(); } } VersionHistory history = VersionUtil.retrieveVersionHistory(context, item); if (versionID == null || versionID.isEmpty()) { Version version = history.getVersion(item); if (version != null) { versionID = String.valueOf(version.getVersionId()); } } String submit = UIUtil.getSubmitButton(request, "submit"); if (submit != null && submit.equals("submit_cancel")) { response.sendRedirect(request.getContextPath() + "/handle/" + item.getHandle()); context.complete(); return; } else if (submit != null && submit.equals("submit_delete")) { String[] versionIDs = request.getParameterValues("remove"); Integer result = doDeleteVersions(request, itemID, versionIDs); if (result != null) { response.sendRedirect(request.getContextPath() + "/tools/history?delete=true&itemID="+history.getLatestVersion().getItemID()); } else { response.sendRedirect(request.getContextPath()); } context.complete(); return; } else if (submit != null && submit.equals("submit_restore")) { doRestoreVersion(request, itemID, versionID); } else if (submit != null && submit.equals("submit_update")) { doUpdateVersion(request, itemID, versionID); response.sendRedirect(request.getContextPath() + "/tools/history?itemID=" + itemID + "&versionID=" + versionID); context.complete(); return; } request.setAttribute("item", item); request.setAttribute("itemID", itemID); request.setAttribute("versionID", versionID); JSPManager.showJSP(request, response, "/tools/version-history.jsp"); }</code><technical_language>This wrong, if item is null IllegalArgumentException thrown</technical_language>

Target:
protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { Integer itemID = UIUtil.getIntParameter(request, "itemID"); String versionID = request.getParameter("versionID"); Item item = Item.find(context, itemID); if (item == null) { throw new IllegalArgumentException("Item is null"); } if(!AuthorizeManager.isAdmin(context, item.getOwningCollection())) { if (new DSpace().getConfigurationService().getPropertyAsType( "versioning.item.history.view.admin", true)) { throw new AuthorizeException(); } } VersionHistory history = VersionUtil.retrieveVersionHistory(context, item); if (versionID == null || versionID.isEmpty()) { Version version = history.getVersion(item); if (version != null) { versionID = String.valueOf(version.getVersionId()); } } String submit = UIUtil.getSubmitButton(request, "submit"); if (submit != null && submit.equals("submit_cancel")) { response.sendRedirect(request.getContextPath() + "/handle/" + item.getHandle()); context.complete(); return; } else if (submit != null && submit.equals("submit_delete")) { String[] versionIDs = request.getParameterValues("remove"); Integer result = doDeleteVersions(request, itemID, versionIDs); if (result != null) { response.sendRedirect(request.getContextPath() + "/tools/history?delete=true&itemID="+history.getLatestVersion().getItemID()); } else { response.sendRedirect(request.getContextPath()); } context.complete(); return; } else if (submit != null && submit.equals("submit_restore")) { doRestoreVersion(request, itemID, versionID); } else if (submit != null && submit.equals("submit_update")) { doUpdateVersion(request, itemID, versionID); response.sendRedirect(request.getContextPath() + "/tools/history?itemID=" + itemID + "&versionID=" + versionID); context.complete(); return; } request.setAttribute("item", item); request.setAttribute("itemID", itemID); request.setAttribute("versionID", versionID); JSPManager.showJSP(request, response, "/tools/version-history.jsp"); }