Put null check first in canHaveProperties

Put the null check first so that we skip the call to exports.getType and the 2 string comparisons if the object is null.