Do not attempt to set empty partition type.

This commit is contained in:
Andrius Štikonas 2017-12-09 19:19:36 +00:00
parent cd33592501
commit e3d01cf25f
1 changed files with 4 additions and 1 deletions

View File

@ -202,8 +202,11 @@ static QLatin1String getPartitionType(FileSystem::Type t, PartitionTable::TableT
bool SfdiskPartitionTable::setPartitionSystemType(Report& report, const Partition& partition)
{
QString partitionType = getPartitionType(partition.fileSystem().type(), m_device->partitionTable()->type());
if (partitionType.isEmpty())
return true;
ExternalCommand sfdiskCommand(report, QStringLiteral("sfdisk"), { QStringLiteral("--part-type"), m_device->deviceNode(), QString::number(partition.number()),
getPartitionType(partition.fileSystem().type(), m_device->partitionTable()->type()) } );
partitionType } );
return sfdiskCommand.run(-1) && sfdiskCommand.exitCode() == 0;
}