# 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 -r 7c3c90468996 -r bd0c15d28dd6 pytouhou/ui/music.pyx --- a/pytouhou/ui/music.pyx Wed Dec 18 22:36:23 2013 +0100 +++ b/pytouhou/ui/music.pyx Sun Mar 23 10:51:19 2014 +0100 @@ -104,5 +104,6 @@ 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)