Fix invalid check for null object in registerGetterSetter