-
-
Notifications
You must be signed in to change notification settings - Fork 709
Fix Simulator crash with empty library #2433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
User description
This fixes a crash because a Realm instance is expected:
Provenance/PVUI/Sources/PVUIBase/SwiftUI/Components/GameContextMenu.swift
Line 40 in ffbdff6
This only occurs in the Simulator with an empty library:
Provenance/PVUI/Sources/PVSwiftUI/Consoles/ConsoleGamesView.swift
Line 1087 in d99a189
PR Type
Bug fix
Description
Fix Simulator crash when library is empty
Ensure Realm instance exists in mock game generation
Wrap mock game creation in Realm write transaction
Properly add generated games to Realm database
Diagram Walkthrough
File Walkthrough
PVGame.swift
Add Realm transaction to mock game generationPVLibrary/Sources/PVRealm/RealmPlatform/Entities/PVGame.swift
mockGeneratemethodrealm.writetransaction blockrealm.add(game)publishDateto use current index instead of count