Avoid javascript error when hasOne relation is empty

When the server's relationship is null/nil, the returned JSON may not contain the key. E.g. Person belongs_to Company, but Company is null/nil for a Person, the JSON for the Person may not have the company attribute.

By detecting for this case, we can avoid a JavaScript error on the sync event.