forked from qt-creator/qt-creator
BinEditor: Fix crash on editor initialization
MemoryAgent::doCreateBinEditor calls openEditorWithContents, with empty contents. The BinEditor fails to handle this case, and crashes when it divides by zero. Task-number: QTCREATORBUG-15835 Change-Id: I8009ef991a445ef4cc192d1bda6a208d51e2b48b Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
83e3d954f9
commit
9057143228
@@ -243,8 +243,10 @@ public:
|
||||
bool setContents(const QByteArray &contents) override
|
||||
{
|
||||
m_widget->clear();
|
||||
m_widget->setSizes(0, contents.length(), contents.length());
|
||||
m_widget->addData(0, contents);
|
||||
if (!contents.isEmpty()) {
|
||||
m_widget->setSizes(0, contents.length(), contents.length());
|
||||
m_widget->addData(0, contents);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user