forked from len0rd/rockbox
rbutil: Fix a crash for devices without bootloader file.
Don't try to get a bootloader filename from an empty list. This happens if the device doesn't have a bootloader file on disk. Change-Id: Idd4c265e7ae298913c5feefb3963120867a0e858
This commit is contained in:
parent
911b216aff
commit
3cebc983a2
1 changed files with 16 additions and 14 deletions
|
@ -116,6 +116,7 @@ void BootloaderInstallBase::progressAborted(void)
|
||||||
bool BootloaderInstallBase::backup(QString to)
|
bool BootloaderInstallBase::backup(QString to)
|
||||||
{
|
{
|
||||||
LOG_INFO() << "Backing up bootloader file";
|
LOG_INFO() << "Backing up bootloader file";
|
||||||
|
if(!m_blfile.isEmpty()) {
|
||||||
QDir targetDir(".");
|
QDir targetDir(".");
|
||||||
emit logItem(tr("Creating backup of original firmware file."), LOGINFO);
|
emit logItem(tr("Creating backup of original firmware file."), LOGINFO);
|
||||||
if(!targetDir.mkpath(to)) {
|
if(!targetDir.mkpath(to)) {
|
||||||
|
@ -129,6 +130,10 @@ bool BootloaderInstallBase::backup(QString to)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
emit logItem(tr("Backup created."), LOGOK);
|
emit logItem(tr("Backup created."), LOGOK);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LOG_INFO() << "Bootloader backup not supported for current device.";
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,9 +220,6 @@ void BootloaderInstallBase::setBlFile(QStringList sl)
|
||||||
m_blfile = sl.at(a);
|
m_blfile = sl.at(a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(m_blfile.isEmpty()) {
|
|
||||||
m_blfile = sl.at(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue