Vurv78 / WebAudio

A safe, efficient and powerful replacement for Streamcore that adds playing & manipulating URL streams through IGmodAudioChannel/BASS
https://steamcommunity.com/sharedfiles/filedetails/?id=2466875474
MIT License
18 stars 4 forks source link

Fix attempting to call IsValid from a possibly nil object #20

Closed StyledStrike closed 3 years ago

StyledStrike commented 3 years ago
@persist WA_TTS:webaudio

...

if (WA_TTS:isValid()) {
    WA_TTS:destroy()
}

WA_TTS = webAudio("...")
WA_TTS:setParent(entity())
WA_TTS:play()

Will throw this error:

sv: Expression 2 (generic): entities/gmod_wire_expression2/core/custom/webaudio.lua:228: attempt to index local 'this' (a nil value)

Vurv78 commented 3 years ago

Nice thanks