commit | 1db6c279a5c942a39cf8278dee74ff4fb0e9ef31 | [log] [tgz] |
---|---|---|
author | Yamagishi Kazutoshi <ykzts@desire.sh> | Fri Jan 26 15:12:16 2018 +0900 |
committer | Andrew Bonventre <andybons@golang.org> | Mon Jan 29 22:16:22 2018 +0000 |
tree | 944a54b54d0756d6f79272bbfd35058c5df0778a | |
parent | 7ae4fa025c2d59c42b428d08ca2e9d2e2fb1ef50 [diff] |
[x/tour] tour: check if file content is set before storing in localStorage file() returns undefined when there is no file to display, like on https://tour.golang.org/welcome/2 Change-Id: Ia26719537949c9909947068d790f07e2eee8f9ff Reviewed-on: https://go-review.googlesource.com/90075 Reviewed-by: Andrew Bonventre <andybons@golang.org> X-Tour-Commit: 8e3b0c2fe87f92ea28e34688bf90a281b991f4ce
diff --git a/tour/static/js/controllers.js b/tour/static/js/controllers.js index e035544..c64fb04 100755 --- a/tour/static/js/controllers.js +++ b/tour/static/js/controllers.js
@@ -22,7 +22,7 @@ var f = file(); return f && f.Content; }, function(val) { - storage.set(file().Hash, val); + if (val) storage.set(file().Hash, val); }); });