MyMacCleaner
MyMacCleaner copied to clipboard
BUG: Lists
When clicking "Deselect all" in a list the app crashes
Hi @bircni, thanks for reporting this issue! 🙏
I tried to replicate the crash on my machine by testing "Deselect All" in all the views that have this feature:
- Home → Smart Scan results
- Disk Cleaner → Scan results
- Duplicates → After scanning for duplicates
- Orphaned Files → After scanning for orphans
- Browser Privacy → Browser data list
Unfortunately, I wasn't able to reproduce the crash on my end.
To help me investigate further, could you please provide some additional information?
- macOS version: Which version of macOS are you running? (e.g., 14.2, 15.0)
- Which view: In which specific view did the crash occur? (Home, Disk Cleaner, Duplicates, etc.)
- Reproduction steps: What actions did you perform before clicking "Deselect All"?
- Crash report: If you have a crash report from Console.app or ~/Library/Logs/DiagnosticReports/, that would be very helpful
In the meantime, I've proactively improved the code to make it more robust:
Changes made:
- Fixed unsafe ForEach pattern in
ScanResultsCard.swift- The view was iterating over sorted indices which could become stale during re-renders - Improved array mutation safety - All
selectAll/deselectAll/toggleCategorySelectionfunctions now create a copy before mutation to ensure SwiftUI's@Publishedproperty wrapper triggers properly and avoids mutation during iteration - Fixed force unwrap in
FileScanner.swift- Replacedcategories.last!with safe optional handling - Fixed CGGradient force unwraps in
SpaceLensView.swift- Added proper guard statements with fallback rendering - Fixed unsafe array access in
PerformanceView.swift- Now uses safefirst(where:)instead of direct index access
These changes should make the app more stable overall, even if they don't directly fix the issue you encountered.
Thanks again for the report, and looking forward to your additional info!