From 6ad9f1d8296164ec53a165572f2971853b0fa5da Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Thu, 19 Apr 2018 10:15:34 -0400 Subject: [PATCH] Call FilePatchController methods on the "real item" --- lib/views/staging-view.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/views/staging-view.js b/lib/views/staging-view.js index fc1963a359..df3b59a3f6 100644 --- a/lib/views/staging-view.js +++ b/lib/views/staging-view.js @@ -436,11 +436,12 @@ export default class StagingView { // due to changes being fully staged/unstaged/stashed/deleted/etc return this.props.workspace.getPanes().filter(pane => { const pendingItem = pane.getPendingItem(); - if (!pendingItem) { return false; } - const isDiffViewItem = pendingItem.getRealItem && pendingItem.getRealItem() instanceof FilePatchController; + if (!pendingItem || !pendingItem.getRealItem) { return false; } + const realItem = pendingItem.getRealItem(); + const isDiffViewItem = realItem instanceof FilePatchController; // We only want to update pending diff views for currently active repo - const isInActiveRepo = pendingItem.getWorkingDirectory() === this.props.workingDirectoryPath; - const isStale = !this.changedFileExists(pendingItem.getFilePath(), pendingItem.getStagingStatus()); + const isInActiveRepo = realItem.getWorkingDirectory() === this.props.workingDirectoryPath; + const isStale = !this.changedFileExists(realItem.getFilePath(), realItem.getStagingStatus()); return isDiffViewItem && isInActiveRepo && isStale; }); }