From 09b497727d68eb9a76cb0bb13ebbd91a7267ca32 Mon Sep 17 00:00:00 2001 From: hexbabe Date: Tue, 31 Oct 2023 14:13:06 -0400 Subject: [PATCH] Removed 'unreachable' else initialization and replaced with error indicating a wtf --- .../AVFoundationBind/AVFoundationBind.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/avfoundation/AVFoundationBind/AVFoundationBind.m b/pkg/avfoundation/AVFoundationBind/AVFoundationBind.m index 4f7f393..a07b5c7 100644 --- a/pkg/avfoundation/AVFoundationBind/AVFoundationBind.m +++ b/pkg/avfoundation/AVFoundationBind/AVFoundationBind.m @@ -46,6 +46,8 @@ } \ } while(0) +static NSString *const UnrecognizedMacOSVersionException = @"UnrecognizedMacOSVersionException"; + @interface VideoDataDelegate : NSObject @property (readonly) AVBindDataCallback mCallback; @@ -191,13 +193,10 @@ STATUS AVBindDevices(AVBindMediaType mediaType, PAVBindDevice *ppDevices, int *p AVCaptureDeviceTypeMicrophone, AVCaptureDeviceTypeExternal, ]; - } - else { - refAllTypes = @[ - AVCaptureDeviceTypeBuiltInWideAngleCamera, - AVCaptureDeviceTypeBuiltInMicrophone, - AVCaptureDeviceTypeExternalUnknown, - ]; + } else { + @throw [NSException exceptionWithName:UnrecognizedMacOSVersionException + reason:@"Unrecognized or unsupported macOS version detected." + userInfo:nil]; } #else refAllTypes = @[