Skip to content

Commit 4b7caee

Browse files
authored
Merge pull request #777 from johzzy/master
fix crash in BGMPlayThrough::IsRunningSomewhereOtherThanBGMApp
2 parents 0aea54f + 7e592eb commit 4b7caee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

BGMApp/BGMApp/BGMPlayThrough.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -933,9 +933,8 @@ void BGMPlayThrough::HandleBGMDeviceIsRunningSomewhereOtherThanBGMApp(BGMPlay
933933
// static
934934
bool BGMPlayThrough::IsRunningSomewhereOtherThanBGMApp(const BGMAudioDevice& inBGMDevice)
935935
{
936-
return CFBooleanGetValue(
937-
static_cast<CFBooleanRef>(
938-
inBGMDevice.GetPropertyData_CFType(kBGMRunningSomewhereOtherThanBGMAppAddress)));
936+
auto type = inBGMDevice.GetPropertyData_CFType(kBGMRunningSomewhereOtherThanBGMAppAddress);
937+
return type && CFBooleanGetValue(static_cast<CFBooleanRef>(type));
939938
}
940939

941940
#pragma mark IOProcs

0 commit comments

Comments
 (0)