From dc8164a3f09d45b8df195df791fa21ddbd2e510d Mon Sep 17 00:00:00 2001
From: Florin Peter <github@florin-peter.de>
Date: Sat, 11 May 2013 00:22:58 +0200
Subject: [PATCH] fix for accessing non object

---
 lib/public/share.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/public/share.php b/lib/public/share.php
index 17fdd33861..418c0028ee 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -1243,13 +1243,14 @@ class Share {
 				'token' => $token, 
 				'run' => $run
 			);
+
 			$run = \OC_Hook::emit(
 				'OCP\Share'
 				, 'pre_shared'
 				, $params
 			);
 			// If hook execution didn't encounter errors
-			if ( $run !== false && !$run->run ) {
+			if ( isset($run->run) && !$run->run ) {
 				$message = 'Sharing '.$itemSource.' failed, because pre share hooks failed';
 				\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
 				return false;
-- 
GitLab