for issue 216

Added in test logic to see if we have an object before we try set the property directly