[square] fixing the NPE in the boolean properties

Change the order of comparison so that NPE doesn't occur on unset properties.