From 2581af0cda076453436a62ce78785626f5cebf36 Mon Sep 17 00:00:00 2001 From: James Allen Date: Fri, 21 Mar 2014 14:48:26 +0000 Subject: [PATCH] Handle deleted files semi-gracefully --- services/web/public/coffee/file-tree/FileTreeManager.coffee | 2 +- .../public/coffee/track-changes/TrackChangesManager.coffee | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/file-tree/FileTreeManager.coffee b/services/web/public/coffee/file-tree/FileTreeManager.coffee index f78629f388..81d40687a9 100644 --- a/services/web/public/coffee/file-tree/FileTreeManager.coffee +++ b/services/web/public/coffee/file-tree/FileTreeManager.coffee @@ -97,7 +97,7 @@ define [ @views[@selected_entity_id].deselect() @selected_entity_id = entity_id @ide.sideBarView.deselectAll() - @views[entity_id].select() + @views[entity_id]?.select() getEntity: (entity_id) -> @views[entity_id]?.model diff --git a/services/web/public/coffee/track-changes/TrackChangesManager.coffee b/services/web/public/coffee/track-changes/TrackChangesManager.coffee index 1f3b66bb1d..ab27d883a1 100644 --- a/services/web/public/coffee/track-changes/TrackChangesManager.coffee +++ b/services/web/public/coffee/track-changes/TrackChangesManager.coffee @@ -127,6 +127,10 @@ define [ if @diffView? @diffView.remove() + if !@diff.get("doc")? + console.log "This document has been deleted. What should we do?" + return + @diffView = new DiffView( model: @diff el: @$el.find(".track-changes-diff")