File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 3030
3131namespace OC \Share20 ;
3232
33+ use OC \Files \Node \File ;
3334use OCP \Files \Cache \ICacheEntry ;
3435use OCP \Files \FileInfo ;
3536use OCP \Files \IRootFolder ;
@@ -233,8 +234,13 @@ public function setNodeType($type) {
233234 */
234235 public function getNodeType () {
235236 if ($ this ->nodeType === null ) {
236- $ info = $ this ->getNodeCacheEntry ();
237- $ this ->nodeType = $ info ->getMimeType () === FileInfo::MIMETYPE_FOLDER ? 'folder ' : 'file ' ;
237+ if ($ this ->getNodeCacheEntry ()) {
238+ $ info = $ this ->getNodeCacheEntry ();
239+ $ this ->nodeType = $ info ->getMimeType () === FileInfo::MIMETYPE_FOLDER ? 'folder ' : 'file ' ;
240+ } else {
241+ $ node = $ this ->getNode ();
242+ $ this ->nodeType = $ node instanceof File ? 'file ' : 'folder ' ;
243+ }
238244 }
239245
240246 return $ this ->nodeType ;
You can’t perform that action at this time.
0 commit comments