shaarli / netscape-bookmark-parser

PHP library to parse Netscape bookmark files
https://packagist.org/packages/shaarli/netscape-bookmark-parser
MIT License
22 stars 10 forks source link

"ksort() expects parameter 1 to be array, null given" when trying to parse an empty bookmarks file #50

Closed Kovah closed 4 years ago

Kovah commented 4 years ago

When trying to import an empty bookmarks file, the process fails with a PHP error:

ksort() expects parameter 1 to be array, null given at /app/vendor/shaarli/netscape-bookmark-parser/NetscapeBookmarkParser.php:203

Instead of this behavior, the parser should either throw a custom exception, or simply return an empty array. The former would be preferable to be as explicit as possible.

ArthurHoaro commented 4 years ago

Thanks for the report.