error: enumeral and non-enumeral type in conditional expression

Change-Id: I97600b95d1d5acfd6ace83585bb77469d53d1705