'if' expects 'bool' but gets 'string'

Change-Id: Id3505946d928992f19e89731e71f281df9243587