Fix crashes from accessing invalid pointers.
This commit is contained in:
parent
ead3ce8a8a
commit
5f2857f12a
2 changed files with 10 additions and 5 deletions
|
|
@ -41,7 +41,10 @@ QueryTool::QueryTool(IDatabaseWindow *context, QWidget *parent)
|
|||
ui->queryEdit->setFont(UserConfiguration::instance()->codeFont());
|
||||
|
||||
highlighter = new SqlSyntaxHighlighter(ui->queryEdit->document());
|
||||
highlighter->setTypes(*m_catalog->types());
|
||||
auto types = m_catalog->types();
|
||||
if (types) {
|
||||
highlighter->setTypes(*types);
|
||||
}
|
||||
|
||||
connect(ui->queryEdit, &QPlainTextEdit::textChanged, this, &QueryTool::queryTextChanged);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue