Skip to content

Commit 536a1a2

Browse files
committed
coreaudio: Added some NULL pointer checks.
These might not be necessary, just trying to track down a reported issue. Reference Issue #12660.
1 parent 712c76f commit 536a1a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/audio/coreaudio/SDL_coreaudio.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static void ResumeAudioDevices(void)
341341

342342
static void InterruptionBegin(SDL_AudioDevice *device)
343343
{
344-
if (device != NULL && device->hidden->audioQueue != NULL) {
344+
if (device != NULL && device->hidden != NULL && device->hidden->audioQueue != NULL) {
345345
device->hidden->interrupted = true;
346346
AudioQueuePause(device->hidden->audioQueue);
347347
}
@@ -366,7 +366,7 @@ - (void)audioSessionInterruption:(NSNotification *)note
366366
{
367367
@synchronized(self) {
368368
NSNumber *type = note.userInfo[AVAudioSessionInterruptionTypeKey];
369-
if (type.unsignedIntegerValue == AVAudioSessionInterruptionTypeBegan) {
369+
if (type && (type.unsignedIntegerValue == AVAudioSessionInterruptionTypeBegan)) {
370370
InterruptionBegin(self.device);
371371
} else {
372372
InterruptionEnd(self.device);

0 commit comments

Comments
 (0)