From c97611482e67bbf481ff3b5fb283bff352a62987 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 19 Jan 2021 14:41:55 -0600 Subject: [PATCH] Fixes crash when previewing DS games without BIOS files --- .../Game Selection/GameCollectionViewController.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Delta/Game Selection/GameCollectionViewController.swift b/Delta/Game Selection/GameCollectionViewController.swift index 893c803..a0f751d 100644 --- a/Delta/Game Selection/GameCollectionViewController.swift +++ b/Delta/Game Selection/GameCollectionViewController.swift @@ -937,6 +937,16 @@ extension GameCollectionViewController return UIContextMenuConfiguration(identifier: indexPath as NSIndexPath, previewProvider: { [weak self] in guard let self = self else { return nil } + + do + { + try self.validateLaunchingGame(game, ignoringErrors: [LaunchError.alreadyRunning]) + } + catch + { + print("Error trying to preview game:", error) + return nil + } let previewViewController = self.makePreviewGameViewController(for: game) previewViewController.isLivePreview = Settings.isPreviewsEnabled