diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 11c3170c2f09efea451f0eb48968ad2e070db0b9..c754ebdbae9b0eb6dd4946176f481aa0e93c443f 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -25,6 +25,10 @@
 		 * @param {OCA.Files.FileList} fileList file list to be extended
 		 */
 		attach: function(fileList) {
+			// core sharing is disabled/not loaded
+			if (!OC.Share) {
+				return;
+			}
 			if (fileList.id === 'trashbin' || fileList.id === 'files.public') {
 				return;
 			}