diff --git a/files/ajax/scan.php b/files/ajax/scan.php index 37ce7ab71f..f7e75d5f8b 100644 --- a/files/ajax/scan.php +++ b/files/ajax/scan.php @@ -22,6 +22,10 @@ if($force or !OC_FileCache::inCache('')){ exit; } }else{ - $eventSource->send('success',false); + if(isset($eventSource)){ + $eventSource->send('success',false); + }else{ + exit; + } } $eventSource->close(); \ No newline at end of file diff --git a/lib/filecache.php b/lib/filecache.php index 689680624a..b4cafe8b31 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -325,7 +325,9 @@ class OC_FileCache{ $mimetype=OC_Filesystem::getMimeType($file); $stat['mimetype']=$mimetype; self::put($file,$stat); - $eventSource->send('scanned',$file); + if($eventSource){ + $eventSource->send('scanned',$file); + } $totalSize+=$stat['size']; } }