forked from qt-creator/qt-creator
Git: Add some null protections
Change-Id: Ia28c70690c6f79499fb8075935ec123b763bcc01 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
This commit is contained in:
committed by
Jarek Kobus
parent
5f131da166
commit
00337585ab
@@ -255,6 +255,8 @@ void GitDiffHandler::show(const QString &id)
|
|||||||
|
|
||||||
void GitDiffHandler::collectShowDescription(const QString &id)
|
void GitDiffHandler::collectShowDescription(const QString &id)
|
||||||
{
|
{
|
||||||
|
if (m_editor.isNull())
|
||||||
|
return;
|
||||||
m_editor->clear(m_waitMessage);
|
m_editor->clear(m_waitMessage);
|
||||||
VcsBase::Command *command = new VcsBase::Command(m_gitPath, m_workingDirectory, m_processEnvironment);
|
VcsBase::Command *command = new VcsBase::Command(m_gitPath, m_workingDirectory, m_processEnvironment);
|
||||||
connect(command, SIGNAL(outputData(QByteArray)), this, SLOT(slotShowDescriptionReceived(QByteArray)));
|
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)
|
void GitDiffHandler::slotShowDescriptionReceived(const QByteArray &data)
|
||||||
{
|
{
|
||||||
|
if (m_editor.isNull())
|
||||||
|
return;
|
||||||
const QString description = m_editor->editorWidget()->codec()->toUnicode(data).remove(QLatin1Char('\r'));
|
const QString description = m_editor->editorWidget()->codec()->toUnicode(data).remove(QLatin1Char('\r'));
|
||||||
|
|
||||||
DiffEditor::DiffShowEditor *editor = qobject_cast<DiffEditor::DiffShowEditor *>(m_editor);
|
DiffEditor::DiffShowEditor *editor = qobject_cast<DiffEditor::DiffShowEditor *>(m_editor);
|
||||||
if (editor) {
|
if (editor)
|
||||||
editor->setDescription(description);
|
editor->setDescription(description);
|
||||||
}
|
|
||||||
|
|
||||||
collectFilesList(QStringList()
|
collectFilesList(QStringList()
|
||||||
<< m_requestedRevisionRange.begin.id
|
<< m_requestedRevisionRange.begin.id
|
||||||
@@ -281,6 +284,8 @@ void GitDiffHandler::slotShowDescriptionReceived(const QByteArray &data)
|
|||||||
|
|
||||||
void GitDiffHandler::collectFilesList(const QStringList &additionalArguments)
|
void GitDiffHandler::collectFilesList(const QStringList &additionalArguments)
|
||||||
{
|
{
|
||||||
|
if (m_editor.isNull())
|
||||||
|
return;
|
||||||
m_editor->clear(m_waitMessage);
|
m_editor->clear(m_waitMessage);
|
||||||
VcsBase::Command *command = new VcsBase::Command(m_gitPath, m_workingDirectory, m_processEnvironment);
|
VcsBase::Command *command = new VcsBase::Command(m_gitPath, m_workingDirectory, m_processEnvironment);
|
||||||
connect(command, SIGNAL(outputData(QByteArray)), this, SLOT(slotFileListReceived(QByteArray)));
|
connect(command, SIGNAL(outputData(QByteArray)), this, SLOT(slotFileListReceived(QByteArray)));
|
||||||
|
|||||||
Reference in New Issue
Block a user