Fixed NPE in UI check (#11714)

Change-Id: I837a15c2ac58119ec203c1b214e19381184c8617