Sync response can be null
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user