Fix division by zero.
This commit is contained in:
parent
b8692e2f16
commit
a0efc8854f
|
@ -158,6 +158,11 @@ QVariantMap ExternalCommandHelper::CopyBlocks(const QString& sourceDevice, const
|
||||||
if (!isCallerAuthorized()) {
|
if (!isCallerAuthorized()) {
|
||||||
return QVariantMap();
|
return QVariantMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoid division by zero further down
|
||||||
|
if (!blockSize) {
|
||||||
|
return QVariantMap();
|
||||||
|
}
|
||||||
QVariantMap reply;
|
QVariantMap reply;
|
||||||
reply[QStringLiteral("success")] = true;
|
reply[QStringLiteral("success")] = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue