Sync response can be null

This commit is contained in:
Mo Bitar
2018-07-16 13:37:13 -05:00
parent 0f74458fd2
commit a699fc0cb7
2 changed files with 2 additions and 2 deletions

View File

@@ -189,7 +189,7 @@ class PasswordWizard {
$scope.resyncData = function(callback) { $scope.resyncData = function(callback) {
modelManager.setAllItemsDirty(); modelManager.setAllItemsDirty();
syncManager.sync().then((response) => { syncManager.sync().then((response) => {
if(response.error) { if(!response || response.error) {
alert(FailedSyncMessage) alert(FailedSyncMessage)
$timeout(() => callback(false)); $timeout(() => callback(false));
} else { } else {

View File

@@ -491,7 +491,7 @@ class ComponentManager {
// Allow handlers to be notified when a save begins and ends, to update the UI // Allow handlers to be notified when a save begins and ends, to update the UI
var saveMessage = Object.assign({}, message); var saveMessage = Object.assign({}, message);
saveMessage.action = response && response.error ? "save-error" : "save-success"; saveMessage.action = response && response.error ? "save-error" : "save-success";
this.replyToMessage(component, message, {error: response.error}) this.replyToMessage(component, message, {error: response && response.error})
this.handleMessage(component, saveMessage); this.handleMessage(component, saveMessage);
}); });
}); });