From 00337585ab9c8faa0cfae3f6ca480f7832ae5f4a Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 1 Jul 2013 23:20:55 +0300 Subject: [PATCH] Git: Add some null protections Change-Id: Ia28c70690c6f79499fb8075935ec123b763bcc01 Reviewed-by: Jarek Kobus --- src/plugins/git/gitclient.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index cccabafd1f1..d23b76add44 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -255,6 +255,8 @@ void GitDiffHandler::show(const QString &id) void GitDiffHandler::collectShowDescription(const QString &id) { + if (m_editor.isNull()) + return; m_editor->clear(m_waitMessage); VcsBase::Command *command = new VcsBase::Command(m_gitPath, m_workingDirectory, m_processEnvironment); connect(command, SIGNAL(outputData(QByteArray)), this, SLOT(slotShowDescriptionReceived(QByteArray))); @@ -267,12 +269,13 @@ void GitDiffHandler::collectShowDescription(const QString &id) void GitDiffHandler::slotShowDescriptionReceived(const QByteArray &data) { + if (m_editor.isNull()) + return; const QString description = m_editor->editorWidget()->codec()->toUnicode(data).remove(QLatin1Char('\r')); DiffEditor::DiffShowEditor *editor = qobject_cast(m_editor); - if (editor) { + if (editor) editor->setDescription(description); - } collectFilesList(QStringList() << m_requestedRevisionRange.begin.id @@ -281,6 +284,8 @@ void GitDiffHandler::slotShowDescriptionReceived(const QByteArray &data) void GitDiffHandler::collectFilesList(const QStringList &additionalArguments) { + if (m_editor.isNull()) + return; m_editor->clear(m_waitMessage); VcsBase::Command *command = new VcsBase::Command(m_gitPath, m_workingDirectory, m_processEnvironment); connect(command, SIGNAL(outputData(QByteArray)), this, SLOT(slotFileListReceived(QByteArray)));