BlitzKraig / fvtt-SoundBoard

Gamemaster Soundboard for Foundry VTT
MIT License
20 stars 17 forks source link

Using the soundboard right after loading a world gets one a null pointer #23

Closed xdy closed 3 years ago

xdy commented 3 years ago

Happened using both the Twodsix system (https://github.com/xdy/twodsix-foundryvtt) and WFRP (https://github.com/moo-man/WFRP4e-FoundryVTT) so seems somewhat system independent. In both cases no other modules were loaded.

Uncaught (in promise) TypeError: Cannot read property 'createGain' of null
    at SBAudioHelper.play (soundboardaudiohelper.js:33)
    at Function.playSound (soundboard.js:114)
    at Function.playSoundOrStopLoop (soundboard.js:89)
    at HTMLButtonElement.onclick (game:1)

A PR with a fix is incoming. Not sure it's a good fix, but it works for me. :) It's possible you can get the same error in other ways, but the fix in the PR should work regardless of reason. As long as you don't mind it messing with your mute. :) It might be a good idea to check the previous mute state and restore it, but as I know nothing about Howler, I'll leave that to you if you think it's a good idea.

BlitzKraig commented 3 years ago

Known issue #8

BlitzKraig commented 3 years ago

Thanks for the PR, I'll get this tested and put it in 1.2

BlitzKraig commented 3 years ago

Fixed in 1.2