core icon indicating copy to clipboard operation
core copied to clipboard

Deleting a Bundle in PP causes a NPE

Open jtesser opened this issue 8 years ago • 2 comments

If an object(content type, content ....) has been pushed AND is in the push history AND the bundle it was pushed in deleted anytime you edit the object in the it will error on a NPE because of teh Push History tab

https://gist.github.com/jtesser/425ee091ecb782138925cacb7336547e

The issue we are trying to read the owner. The JSP accounts for the delete of the environment BUT not the bundle

<%
	for(PushedAsset pushedAsset: pushedAssets) {
		Environment env = APILocator.getEnvironmentAPI().findEnvironmentById(pushedAsset.getEnvironmentId());
		Bundle bundle = APILocator.getBundleAPI().getBundleById(pushedAsset.getBundleId());
		User owner = APILocator.getUserAPI().loadUserById(bundle.getOwner());
%>
	<tr  >
		<td><%= owner.getFullName() %></td>
		<td><%= UtilMethods.dateToHTMLDate(pushedAsset.getPushDate()) %> - <%= UtilMethods.dateToHTMLTime(pushedAsset.getPushDate()) %></td>
		 <td><%= (env != null) ? env.getName() : LanguageUtil.get(pageContext, "deleted") %></td>
		 <td nowrap="nowrap">
			<%= pushedAsset.getBundleId() %>
		</td>
	</tr>

jtesser avatar Jan 25 '18 13:01 jtesser

Unable to reproduce after the last changes... Passed

bryanboza avatar Jan 30 '18 21:01 bryanboza

Passed QA.

  • Pushed page inside and outside a bundle to receiver server
  • Deleted bundle from Push History tab in receiver server
  • Edited page in receiver server
  • No NPE error in logs.

Tested on release-4.3.0 branch Mac OS 10.10 / Postgres 9.6.6 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8.6

shaydotcms avatar Feb 12 '18 18:02 shaydotcms