Fix a not properly handled pointer comparison that caused UB am: 7f5c6593f2 am: 6ae350fa22
am: f42b1b66ca

Change-Id: Ifff5a9b1a2232e17e2ace087126fae7fd67a2f00