From 7e592ebb2b04d68cb7649cf5424e91aaff83b227 Mon Sep 17 00:00:00 2001 From: Johnny Date: Wed, 4 Dec 2024 14:38:24 +0800 Subject: [PATCH] fix crash in BGMPlayThrough::IsRunningSomewhereOtherThanBGMApp --- BGMApp/BGMApp/BGMPlayThrough.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BGMApp/BGMApp/BGMPlayThrough.cpp b/BGMApp/BGMApp/BGMPlayThrough.cpp index 964d91e..1d614a6 100644 --- a/BGMApp/BGMApp/BGMPlayThrough.cpp +++ b/BGMApp/BGMApp/BGMPlayThrough.cpp @@ -933,9 +933,8 @@ void BGMPlayThrough::HandleBGMDeviceIsRunningSomewhereOtherThanBGMApp(BGMPlay // static bool BGMPlayThrough::IsRunningSomewhereOtherThanBGMApp(const BGMAudioDevice& inBGMDevice) { - return CFBooleanGetValue( - static_cast( - inBGMDevice.GetPropertyData_CFType(kBGMRunningSomewhereOtherThanBGMAppAddress))); + auto type = inBGMDevice.GetPropertyData_CFType(kBGMRunningSomewhereOtherThanBGMAppAddress); + return type && CFBooleanGetValue(static_cast(type)); } #pragma mark IOProcs