fix(sync): fix for when data is null, ie. server offline

This commit is contained in:
Matteo Pagliazzi 2015-01-16 17:33:15 +01:00
parent 1f1cd750cb
commit 4a22b1dc57

View file

@ -77,7 +77,7 @@ angular.module('userServices', [])
//we can't do user=data as it will not update user references in all other angular controllers.
// the user has been modified from another application, sync up
if(data.wasModified) {
if(data && data.wasModified) {
delete data.wasModified;
$rootScope.$emit('userUpdated', user);
}