mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-14 15:53:14 +00:00
coreaudio: Added some NULL pointer checks.
These might not be necessary, just trying to track down a reported issue. Reference Issue #12660.
This commit is contained in:
@@ -341,7 +341,7 @@ static void ResumeAudioDevices(void)
|
||||
|
||||
static void InterruptionBegin(SDL_AudioDevice *device)
|
||||
{
|
||||
if (device != NULL && device->hidden->audioQueue != NULL) {
|
||||
if (device != NULL && device->hidden != NULL && device->hidden->audioQueue != NULL) {
|
||||
device->hidden->interrupted = true;
|
||||
AudioQueuePause(device->hidden->audioQueue);
|
||||
}
|
||||
@@ -366,7 +366,7 @@ static void InterruptionEnd(SDL_AudioDevice *device)
|
||||
{
|
||||
@synchronized(self) {
|
||||
NSNumber *type = note.userInfo[AVAudioSessionInterruptionTypeKey];
|
||||
if (type.unsignedIntegerValue == AVAudioSessionInterruptionTypeBegan) {
|
||||
if (type && (type.unsignedIntegerValue == AVAudioSessionInterruptionTypeBegan)) {
|
||||
InterruptionBegin(self.device);
|
||||
} else {
|
||||
InterruptionEnd(self.device);
|
||||
|
||||
Reference in New Issue
Block a user