{"action":"created","issue":{"url":"https://api.github.com/repos/BobRay/ClassExtender/issues/3","labels_url":"https://api.github.com/repos/BobRay/ClassExtender/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/BobRay/ClassExtender/issues/3/comments","events_url":"https://api.github.com/repos/BobRay/ClassExtender/issues/3/events","html_url":"https://github.com/BobRay/ClassExtender/issues/3","id":53153220,"number":3,"title":"userData don't yet exists when onUserFormSave is invoked?","user":{"login":"whitebyte","id":7704186,"avatar_url":"https://avatars.githubusercontent.com/u/7704186?v=3","gravatar_id":"","url":"https://api.github.com/users/whitebyte","html_url":"https://github.com/whitebyte","followers_url":"https://api.github.com/users/whitebyte/followers","following_url":"https://api.github.com/users/whitebyte/following{/other_user}","gists_url":"https://api.github.com/users/whitebyte/gists{/gist_id}","starred_url":"https://api.github.com/users/whitebyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitebyte/subscriptions","organizations_url":"https://api.github.com/users/whitebyte/orgs","repos_url":"https://api.github.com/users/whitebyte/repos","events_url":"https://api.github.com/users/whitebyte/events{/privacy}","received_events_url":"https://api.github.com/users/whitebyte/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-30T22:37:46Z","updated_at":"2015-01-06T18:20:09Z","closed_at":"2015-01-06T08:15:22Z","body":"Hello, Bob. I have a strange issue with my ClassExtended user profile. I have a plugin that fires on onUserFormSave event. According to RTFM, the user object should already exist, but *sometimes* when i trying to access user's data object, i recieve null\r\n```php\r\n$data = $modx->getObject('userData', array('userdata_id' => $id));\r\n\r\nif (is_null($data)) {\r\n        $modx->log(modX::LOG_LEVEL_ERROR, 'data is null');\r\n}\r\n```\r\nUsually $data is null, *sometimes* is an object. Is this sort of a race condition? \r\nI've tried a dirty hack:\r\n```php\r\nif (is_null($data)) {\r\n        $modx->log(modX::LOG_LEVEL_ERROR, 'data is null');\r\n        sleep(3);\r\n        $data = $modx->getObject('userData', array('userdata_id' => $id));\r\n        \r\n        if (is_null($data)) {\r\n            $modx->log(modX::LOG_LEVEL_ERROR, 'data is still null, aborting');\r\n            return false;\r\n        }\r\n    }\r\n```\r\nin some rare cases this code gives object, not null. I don't understand it at all."},"comment":{"url":"https://api.github.com/repos/BobRay/ClassExtender/issues/comments/68907300","html_url":"https://github.com/BobRay/ClassExtender/issues/3#issuecomment-68907300","issue_url":"https://api.github.com/repos/BobRay/ClassExtender/issues/3","id":68907300,"user":{"login":"BobRay","id":335010,"avatar_url":"https://avatars.githubusercontent.com/u/335010?v=3","gravatar_id":"","url":"https://api.github.com/users/BobRay","html_url":"https://github.com/BobRay","followers_url":"https://api.github.com/users/BobRay/followers","following_url":"https://api.github.com/users/BobRay/following{/other_user}","gists_url":"https://api.github.com/users/BobRay/gists{/gist_id}","starred_url":"https://api.github.com/users/BobRay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BobRay/subscriptions","organizations_url":"https://api.github.com/users/BobRay/orgs","repos_url":"https://api.github.com/users/BobRay/repos","events_url":"https://api.github.com/users/BobRay/events{/privacy}","received_events_url":"https://api.github.com/users/BobRay/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T18:20:09Z","updated_at":"2015-01-06T18:20:09Z","body":"You're welcome!"}}