diff --git a/core/js/share.js b/core/js/share.js index 4c8fd87410..e59669cbc2 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -92,6 +92,7 @@ OC.Share={ } } if (shares) { + OC.Share.statuses[itemSource] = OC.Share.statuses[itemSource] || {}; OC.Share.statuses[itemSource]['link'] = link; } else { delete OC.Share.statuses[itemSource]; @@ -122,7 +123,12 @@ OC.Share={ callback(result.data); } } else { - OC.dialogs.alert(result.data.message, t('core', 'Error while sharing')); + if (result.data && result.data.message) { + var msg = result.data.message; + } else { + var msg = t('core', 'Error'); + } + OC.dialogs.alert(msg, t('core', 'Error while sharing')); } }); },