Get rid of a null pointer exception.

@bug W-1779224@

@rev amcculloch@
Merging origin/goliver/master-pending-W-1779224 into master