# HG changeset patch # User Emmanuel Gil Peyrot # Date 1395568279 -3600 # Node ID bd0c15d28dd62a9961a2a859d2b4c73d75bbe1c4 # Parent 7c3c9046899672e390110dec2317ac244373c826 Always verify chunks are not None before using them, fix crash when audio is disabled. diff --git a/pytouhou/ui/music.pyx b/pytouhou/ui/music.pyx --- a/pytouhou/ui/music.pyx +++ b/pytouhou/ui/music.pyx @@ -104,5 +104,6 @@ cdef class SFXPlayer(MusicPlayer): sound.play(channel, 0) cpdef set_volume(self, name, float volume): - chunk = self.get_sound(name) - chunk.set_volume(volume) + sound = self.get_sound(name) + if sound is not None: + sound.set_volume(volume)