Bassman2 / MediaDevices

MTP Library
MIT License
99 stars 37 forks source link

Exception in `MediaDevice.VendorOpcodes` - 'ToInt does not work for value type VT_UI4' #110

Open finlaybob opened 1 year ago

finlaybob commented 1 year ago

Describe the bug Method throws InvalidOperationException on returning.

System.InvalidOperationException: ToInt does not work for value type VT_UI4
   at MediaDevices.Internal.PropVariantFacade.ToInt()
   at MediaDevices.MediaDevice.<>c.<VendorOpcodes>b__150_0(PropVariantFacade p)
   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()

To Reproduce Steps to reproduce the behavior:

  1. Connect a device
  2. Run the following code.
    var device = MediaDevice.GetDevices().First();
    var device.Connect();
    var opcodes = device.VendorOpcodes().ToArray();

    Expected behavior An IEnumerable of ints is returned.

Device Samsung A33 5G, Android 13 Apple iPhone 6, iOS 12.5.7

Version: Nuget Package 1.10.0

Additional context Add any other context about the problem here.