Merge "Fix potential NULL dereference errors."
am: bce5b2f971

Change-Id: I10269f5f412f544fda36700158a9d528b2549334