NEXUS-6282: Added nullcheck.
Merge pull request #374 from sonatype/NEXUS-6282-nullcheck

NEXUS-6282: Added nullcheck.