From 5160ea60639d58a054359834d7ac6e82096c4d57 Mon Sep 17 00:00:00 2001
From: Victor Dubiniuk <victor.dubiniuk@gmail.com>
Date: Mon, 22 Jul 2013 21:02:18 +0300
Subject: [PATCH] Show generic error when there is no error

---
 core/js/share.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/js/share.js b/core/js/share.js
index 4c8fd87410..71e6136bf7 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -122,7 +122,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'));
 			}
 		});
 	},
-- 
GitLab