I encountered an error today relating to retrieving images from a Nikon D5:
It related to CameraControl.Devices\BaseMTPCamera and the method:
public override AsyncObservableCollection GetObjects(object storageId, bool loadThumbs)
When checking the response data the array can ben empty but not null, I believe we should check the array length to ensure there is data before trying to covert it. the call:
int objCount = BitConverter.ToInt32(response.Data, 0); Threw the exception : Index was out of range.
I thinks this could be addressed with an additional check after the null check:
if (response.Data.Length == 0)
{
Log.Debug("Empty response data from read.");
return res;
}
I encountered an error today relating to retrieving images from a Nikon D5:
It related to CameraControl.Devices\BaseMTPCamera and the method:
public override AsyncObservableCollection GetObjects(object storageId, bool loadThumbs)
When checking the response data the array can ben empty but not null, I believe we should check the array length to ensure there is data before trying to covert it. the call:
int objCount = BitConverter.ToInt32(response.Data, 0); Threw the exception : Index was out of range.
I thinks this could be addressed with an additional check after the null check: