Skip to content
Snippets Groups Projects
Commit 18cff29d authored by hjk's avatar hjk Committed by Christian Kandeler
Browse files

bineditor: don't crash when no error string is requested


Task-number: QTCREATORBUG-7930
Change-Id: Ia3b2a21d843ce9de7f61f754da0b276355c377f2
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent e81cfa6e
No related branches found
No related tags found
No related merge requests found
......@@ -223,7 +223,11 @@ public:
bool open(QString *errorString, const QString &fileName, quint64 offset = 0) {
QFile file(fileName);
if (offset >= static_cast<quint64>(file.size())) {
*errorString = tr("The Binary Editor can not open empty files.");
QString msg = tr("The Binary Editor can not open empty files.");
if (errorString)
*errorString = msg;
else
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), msg);
return false;
}
if (file.open(QIODevice::ReadOnly)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment