From 0d98776d5483d52c1c0bf36e643a19675c2e6ee1 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 24 Mar 2015 19:28:24 -0400 Subject: [PATCH] Fix NPE and other small issues with the new image view --- external_libraries.py | 2 +- static/js/graphing.js | 7 +++++-- static/js/pages/image-view.js | 2 +- static/partials/image-view.html | 13 +++++++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/external_libraries.py b/external_libraries.py index 113295353..7004a2cca 100644 --- a/external_libraries.py +++ b/external_libraries.py @@ -21,7 +21,7 @@ EXTERNAL_CSS = [ 'netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css', 'netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css', 'fonts.googleapis.com/css?family=Source+Sans+Pro:400,700', - 'cdn.core-os.net/icons/core-icons.css' + 's3.amazonaws.com/cdn.core-os.net/icons/core-icons.css' ] EXTERNAL_FONTS = [ diff --git a/static/js/graphing.js b/static/js/graphing.js index 7ccfcf2df..5a5ee2018 100644 --- a/static/js/graphing.js +++ b/static/js/graphing.js @@ -1157,8 +1157,11 @@ FileTreeBase.prototype.populateAndDraw_ = function() { } this.root_ = this.nodeMap_['']; - this.root_.x0 = 0; - this.root_.y0 = 0; + if (this.root_) { + this.root_.x0 = 0; + this.root_.y0 = 0; + } + this.toggle_(this.root_); this.update_(this.root_); }; diff --git a/static/js/pages/image-view.js b/static/js/pages/image-view.js index 945fdc66e..347854d3d 100644 --- a/static/js/pages/image-view.js +++ b/static/js/pages/image-view.js @@ -73,7 +73,7 @@ }; $scope.initializeTree = function() { - if ($scope.tree) { return; } + if ($scope.tree || !$scope.combinedChanges.length) { return; } $scope.tree = new ImageFileChangeTree($scope.image, $scope.combinedChanges); $timeout(function() { diff --git a/static/partials/image-view.html b/static/partials/image-view.html index 421c685dd..615361ee3 100644 --- a/static/partials/image-view.html +++ b/static/partials/image-view.html @@ -40,8 +40,17 @@

Image File Changes

-
+
+
No file changes
+
+ There were no file system changes in this image layer. +
+
+ +
+
+