Commit 33a6f76d authored by Nicholas Little's avatar Nicholas Little Committed by Andrés G. Aragoneses

Mtp: Check error stack on battery status error

parent c0cb2536
......@@ -307,8 +307,10 @@ namespace Mtp
internal static void GetBatteryLevel (MtpDeviceHandle handle, out ushort maxLevel, out ushort currentLevel)
{
int result = LIBMTP_Get_Batterylevel (handle, out maxLevel, out currentLevel);
if (result != 0)
if (result != 0) {
LibMtpException.CheckErrorStack (handle);
throw new LibMtpException (ErrorCode.General, "Could not retrieve battery stats");
}
}
internal static void GetConnectedDevices (out IntPtr list)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment