Fix a NPE and add logging to catch offender in the future

Change-Id: Ic177ad71231e2210b17601e6718123b47634f26f
Fixes: 121116425
Test: robotests
2 files changed