Fix build under Fedora 19.

Fix crash when listing an unknown device.
This commit is contained in:
Jason Ferrara 2013-11-25 22:49:19 -05:00
parent 82ec2cfde1
commit 0e1002f7dd
2 changed files with 9 additions and 2 deletions

View File

@ -92,9 +92,15 @@ ConnectedDeviceInfo ConnectedMtpDevices::GetDeviceInfo(int index)
info.bus_location = m_devs[index].bus_location;
info.devnum = m_devs[index].devnum;
info.device_flags = m_devs[index].device_entry.device_flags;
info.product = m_devs[index].device_entry.product;
if (m_devs[index].device_entry.product)
info.product = m_devs[index].device_entry.product;
else
info.product = "UNKNOWN";
info.product_id = m_devs[index].device_entry.product_id;
info.vendor = m_devs[index].device_entry.vendor;
if (m_devs[index].device_entry.vendor)
info.vendor = m_devs[index].device_entry.vendor;
else
info.vendor = "UNKNOWN";
info.vendor_id = m_devs[index].device_entry.vendor_id;
return info;

View File

@ -32,6 +32,7 @@
#include <sstream>
#include <iomanip>
#include <assert.h>
#include <unistd.h>
#define JMTPFS_VERSION "0.4"