Просмотр исходного кода

mac-avcapture: Fix NSString being initialized with NULL

Calling [NSString stringWithUTF8String:] with NULL causes it to raise an
exception: +[NSString stringWithUTF8String:]: NULL cString
Palana 10 лет назад
Родитель
Сommit
41c32fd6b6
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      plugins/mac-avcapture/av-capture.m

+ 1 - 1
plugins/mac-avcapture/av-capture.m

@@ -639,7 +639,7 @@ static bool update_device_list(obs_property_t *list,
 	size_t size = obs_property_list_item_count(list);
 	for (size_t i = 0; i < size;) {
 		const char *uid_ = obs_property_list_item_string(list, i);
-		bool found       = [uid isEqualToString:@(uid_)];
+		bool found       = [uid isEqualToString:@(uid_ ? uid_ : "")];
 		bool disabled    = obs_property_list_item_disabled(list, i);
 		if (!found && !disabled) {
 			i += 1;