From 66afd1aa3925f31f347edfc5dae7adf7603ba5c6 Mon Sep 17 00:00:00 2001
From: Vincent Petry <pvince81@owncloud.com>
Date: Wed, 28 May 2014 16:34:00 +0200
Subject: [PATCH] Fix fileList fallback in OC.Share for outside files app

OC.Share can be used in non-files apps, so the fileList callback needs
to support that as well.
---
 core/js/share.js | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/core/js/share.js b/core/js/share.js
index 894f0d488f..90f6c7fdc7 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -37,9 +37,16 @@ OC.Share={
 	 */
 	updateIcons:function(itemType, fileList){
 		var item;
-		fileList = fileList || OCA.Files.App.fileList;
-		var $fileList = fileList.$fileList;
-		var currentDir = fileList.getCurrentDirectory();
+		var $fileList;
+		var currentDir;
+		if (!fileList && OCA.Files) {
+			fileList = OCA.Files.App.fileList;
+		}
+		// fileList is usually only defined in the files app
+		if (fileList) {
+			$fileList = fileList.$fileList;
+			currentDir = fileList.getCurrentDirectory();
+		}
 		for (item in OC.Share.statuses){
 			var image;
 			var data = OC.Share.statuses[item];
-- 
GitLab