Merge "Fix potential NULL dereference errors." am: bce5b2f971 am: 76451438d9
am: 621afac235

Change-Id: Id7a8506c6ee2667f6a303905359a99e80dbced9d