Skip to content

Commit

Permalink
Handle missing scene during snapshot creation. reported via crashrepo…
Browse files Browse the repository at this point in the history
…rter
  • Loading branch information
EthanArbuckle committed Jan 7, 2021
1 parent 35bd8f3 commit 3aa66a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CRCarplayWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ - (void)setupLiveAppView
{
// Now that the app is launched and presumably in landscape mode, save a snapshot.
// If an app does not natively support landscape mode and doesn't ship a landscape launch image, this snapshot can be used during cold-launches
id appScene = objcInvoke(sceneHandle, @"scene");
id appScene = objcInvoke(sceneHandle, @"sceneIfExists");
if (!appScene)
{
return;
}
id sceneSettings = objcInvoke(appScene, @"mutableSettings");
objcInvoke_1(sceneSettings, @"setInterfaceOrientation:", self.orientation);
id snapshotContext = objcInvoke_2(objc_getClass("FBSSceneSnapshotContext"), @"contextWithSceneID:settings:", objcInvoke(appScene, @"identifier"), sceneSettings);
Expand Down

0 comments on commit 3aa66a3

Please sign in to comment.