enl / flysystem-cloudinary

Cloudinary adapter for Flysystem
MIT License
27 stars 20 forks source link

`TypeError` on listContents with non-existent directory #21

Closed enl closed 7 years ago

enl commented 7 years ago

First this notice is thrown:

PHP Notice:  Undefined index: files in /private/var/www/enl/flysystem-cloudinary/src/CloudinaryAdapter.php on line 229

and finally:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to League\Flysystem\Util\ContentListingFormatter::formatListing() must be of the type array, null given, called in /private/var/www/enl/flysystem-cloudinary/vendor/league/flysystem/src/Filesystem.php on line 273 and defined in /private/var/www/enl/flysystem-cloudinary/vendor/league/flysystem/src/Util/ContentListingFormatter.php:38
Stack trace:
#0 /private/var/www/enl/flysystem-cloudinary/vendor/league/flysystem/src/Filesystem.php(273): League\Flysystem\Util\ContentListingFormatter->formatListing(NULL)
#1 /private/var/www/enl/flysystem-cloudinary/test.php(20): League\Flysystem\Filesystem->listContents('tests', true)
#2 {main}
  thrown in /private/var/www/enl/flysystem-cloudinary/vendor/league/flysystem/src/Util/ContentListingFormatter.php on line 38

Expected behavior:

return empty array, like local adapter does.