KNL-1132 Minor change to protect against NPE which can happen when certain methods are used internally in the kernel



git-svn-id: https://source.sakaiproject.org/svn/kernel@130787 66ffb92e-73f9-0310-93c1-f5514f145a0a