Let's be more defensive here by checking for null return objects.

Change-Id: I5164e7d82f882ea9fe296a5a2df616d396d6726f