From 91536ae7812e904334b0007445a64aecf3e120ad Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Thu, 23 Apr 2020 15:57:31 +0300 Subject: [PATCH] BareMetal: Don't handle an empty SVD file selection in UVSC provider Change-Id: Ic7fbf2c403f85d7d79f194a12f67e852ff0bdd80 Reviewed-by: hjk --- .../debugservers/uvsc/uvtargetdevicemodel.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp index e9a33428576..f627367828c 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp @@ -454,11 +454,13 @@ DeviceSelection DeviceSelectionView::buildSelection(const DeviceSelectionItem *i } } while ((item->level() > 1) && (item = static_cast(item->parent()))); - // Fix relative SVD file path to make it as absolute. - const QFileInfo fi(selection.svd); - if (!fi.isAbsolute()) { - const QDir dir(QFileInfo(selection.package.file).path()); - selection.svd = QFileInfo(dir, fi.filePath()).absoluteFilePath(); + // Fix relative SVD file sub-path to make it as an absolute file path. + if (!selection.svd.isEmpty()) { + const QFileInfo fi(selection.svd); + if (!fi.isAbsolute()) { + const QDir dir(QFileInfo(selection.package.file).path()); + selection.svd = QFileInfo(dir, fi.filePath()).absoluteFilePath(); + } } return selection;