Fix a crash that occurs when mounting a device with an empty backends container. Fixes issue 2121

This commit is contained in:
Black Jack 2011-08-05 08:20:04 +01:00 committed by David Sansome
parent 8091f9d1cd
commit 3de111d84f

View File

@ -247,7 +247,7 @@ QVariant DeviceManager::data(const QModelIndex& index, int role) const {
case Qt::DecorationRole: {
QPixmap pixmap = info.icon_.pixmap(kDeviceIconSize);
if (!info.BestBackend()->lister_) {
if (info.backends_.isEmpty() || !info.BestBackend()->lister_) {
// Disconnected but remembered
QPainter p(&pixmap);
p.drawPixmap(kDeviceIconSize - kDeviceIconOverlaySize,