model can be null (for #12884)

This commit is contained in:
Benjamin Pasero
2016-09-28 15:37:35 +02:00
parent 82e929bd0f
commit 2bb86f8974

View File

@@ -74,7 +74,8 @@ class OpenInDiffAction extends baseeditor.EditorInputAction {
return false;
}
if (!(typeof this.gitService.getModel().getRepositoryRoot() === 'string')) {
const model = this.gitService.getModel();
if (!model || !(typeof model.getRepositoryRoot() === 'string')) {
return false;
}
@@ -165,7 +166,8 @@ class OpenInEditorAction extends baseeditor.EditorInputAction {
return false;
}
if (!(typeof this.gitService.getModel().getRepositoryRoot() === 'string')) {
const model = this.gitService.getModel();
if (!model || !(typeof model.getRepositoryRoot() === 'string')) {
return false;
}