Skip to content
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

[iOS] Crash when rearranging drive downwards in the list #2322

Closed
conath opened this issue Feb 19, 2021 · 1 comment
Closed

[iOS] Crash when rearranging drive downwards in the list #2322

conath opened this issue Feb 19, 2021 · 1 comment

Comments

@conath
Copy link
Contributor

conath commented Feb 19, 2021

Describe the issue
Crash when rearranging drives. To reproduce, create a VM and go to Configuration → Drives. Add two removable drives. Now tap Edit, then drag the top drive below the second drive. Crash.

Configuration

  • UTM Version: latest
  • OS Version: latest
  • Device Model: iPad Pro 11" 2018
  • Is it jailbroken (name jailbreak used)? No
  • How did you install UTM? Xcode

Crash location
Crash is in NSArray due to index out of bounds. The index where the moved drive is inserted needs to be decremented by one if it is moved past its old position. (e. g. moved from first to second spot, meaning down)
Call stack is:
VMConfigDrivesView.swift line 113 (moveDrives) [by the way, is that a typo? it only moves one drive]
UTMConfiguration+Drives.m line 194 (moveDrive)

index

@conath conath changed the title Crash when rearranging drive downwards in the list [iOS] Crash when rearranging drive downwards in the list Feb 19, 2021
@osy
Copy link
Contributor

osy commented Feb 21, 2021

SwiftUI .onMove supports multiple items even though I don't know how that is done on the UI side.

@osy osy closed this as completed in a736b21 Feb 21, 2021
osy added a commit that referenced this issue Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants