summaryrefslogtreecommitdiff
path: root/lists.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-07-28 14:18:44 +0200
committerjmoenig <jens@moenig.org>2014-07-28 14:18:44 +0200
commitd559312b0776891cb196eeb2739c311fd7909ee6 (patch)
treef220b74213c3757dbc5a25a5680b8192dda672f5 /lists.js
parente362730a0ce8a062cb29f9f306192394ad9d37e5 (diff)
downloadsnap-d559312b0776891cb196eeb2739c311fd7909ee6.tar.gz
snap-d559312b0776891cb196eeb2739c311fd7909ee6.zip
fixed "Load Failed Type Error Cannot read property 'isLinked' of null"
you guys need to at least *try* your stuff on a few actual projects, dammit!
Diffstat (limited to 'lists.js')
-rw-r--r--lists.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/lists.js b/lists.js
index dfd8b1e..a4aff6c 100644
--- a/lists.js
+++ b/lists.js
@@ -61,7 +61,7 @@ PushButtonMorph, SyntaxElementMorph, Color, Point, WatcherMorph,
StringMorph, SpriteMorph, ScrollFrameMorph, CellMorph, ArrowMorph,
MenuMorph, snapEquals, Morph, isNil, localize, MorphicPreferences*/
-modules.lists = '2014-July-27';
+modules.lists = '2014-July-28';
var List;
var ListWatcherMorph;
@@ -273,12 +273,14 @@ List.prototype.becomeArray = function () {
if (this.isLinked) {
var next = this, i;
this.contents = [];
- while (next.isLinked) {
+ while (next && next.isLinked) {
this.contents.push(next.first);
next = next.rest;
}
- for (i = 1; i <= next.contents.length; i += 1) {
- this.contents.push(next.at(i));
+ if (next) {
+ for (i = 1; i <= next.contents.length; i += 1) {
+ this.contents.push(next.at(i));
+ }
}
this.isLinked = false;
this.first = null;