Catch mediatomb browse errors
authorChristian Weiske <cweiske@cweiske.de>
Tue, 19 Dec 2017 20:17:56 +0000 (21:17 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 19 Dec 2017 20:17:56 +0000 (21:17 +0100)
src/mediatomb.php

index 96be27c..33b9bd8 100644 (file)
@@ -25,6 +25,11 @@ function mediatombBrowse(Services_MediaTomb $smt, $fullPath, $prefix)
 
     $path = substr($fullPath, strlen($prefix));
     $container = $smt->getContainerByPath($path);
+    if ($container === null) {
+        sendMessage('Error accessing ' . $fullPath);
+        return;
+    }
+
     $listItems = array();
 
     $it = $container->getItemIterator(false);