-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Crash when opening VM Configuration with a removable drive present #2284
Comments
I have verified that solution 2 prevents the crash. I have also discovered that there is a certain circumstance in which a removable drive will have the path The empty string comes from creating a new drive, which results in an empty string passed and saved as path that is retained if the drive is later changed to be removable (this is currently impossible in the UI but was possible in a previous version). The empty string in the removable drive configuration is also set in legacy UI I suggest changing the implementation of |
Fix crash when opening VM configuration #2284
Steps to reproduce
Location and reason of crash
While checking for "orphaned" drive images on the file system, the new
orphanedDrives
method tries to get thedriveImagePathForIndex
for all drives (UTMConfiguration+Drives.m line 75), even though this path isn't set for removable drives (their file reference is stored in the ViewState as bookmark).Technical cause of crash
The result of
driveImagePathForIndex
is added to anNSMutableSet
, which can't handlenil
values. This causes a crash in[__NSSetM addObject:]:
becauseobject cannot be nil
.Solution
There are two solutions:
driveImagePathForIndex
isnil
and don't add it in that case.i
is removable (driveRemovableForIndex
) and don't add it in that case.Since a non-removable drive by definition always has an image path, I believe solution 2 should be implemented.
The text was updated successfully, but these errors were encountered: