Skip to content

Commit 533af6a

Browse files
committed
Fixing nil model name crash in unit tests
1 parent 43b6be4 commit 533af6a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignalHelper.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,11 @@ + (NSString*)getDeviceVariant {
478478
return @"Mac";
479479
#elif TARGET_OS_SIMULATOR
480480
let model = UIDevice.currentDevice.model;
481-
return [@"Simulator " stringByAppendingString:model];
481+
if (model) {
482+
return [@"Simulator " stringByAppendingString:model];
483+
} else {
484+
return @"Simulator";
485+
}
482486
#endif
483487
return systemInfoMachine;
484488
}

0 commit comments

Comments
 (0)