dragonmc77 / AddLink

AddLink Extension for Playnite
8 stars 1 forks source link

Fails when there isn't at least one existing link for a game #1

Closed SlipperyJim closed 5 years ago

SlipperyJim commented 5 years ago

Error is 'You cannot call a method on a null-valued expression'

dragonmc77 commented 5 years ago

I can't seem to be able to reproduce this. On my local install I attempted to run the script on several games with no links listed in Links tab. The script added the MetaCritic/IGDB link as the first link without any errors.

SlipperyJim commented 5 years ago

Are you deleting existing links and then running it? Because that works on mine as well. It is only when the game has never had a link that it happens (at least for me and it is consistent - have tried it on three different games now).

dragonmc77 commented 5 years ago

Added a check for null on the Links collection, which is apparently returned when the game has never had any links. A new Links collection is initialized and added to the game, which allows the attempt to add a link to be successful.

SlipperyJim commented 5 years ago

Thanks - now works perfectly for me. Hope you carry on and add some more functionality if possible - Playnite could do with some extensions to add more metadata.