TimeForANinja/node-ytpl

Cannot read property 'split' of null

SwanX1 opened this issue · 2 comments

Function.main.validateURL (C:\Users\Karlis\Desktop\co\node\receptionist\node_modules\ytpl\lib\main.js:94:29)

The TypeError: Cannot read property 'split' of null occurs when argument link of main.validateURL is an empty string or whitespace, since the property pathname will always be null when such circumstances occur.
Can be solved outside the package checking if parsed.pathname === null beforehand, however it is good practice to do that in the package too.

🤔 guess i missed out on that

added to rework in a0ea805
also added tests so it doesn't happen again
👍