diff options
| author | jmoenig <jens@moenig.org> | 2014-07-17 09:51:25 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-07-17 09:51:25 +0200 |
| commit | 3dbe001d6f47c0cf6dd9f34ca746201894a32dd7 (patch) | |
| tree | 21ad255096ea959feff1785d7f6d7350c41e9fa9 /lists.js | |
| parent | ff854784c0bb86c2a28818284876b045cabc10a1 (diff) | |
| download | snap-byow-3dbe001d6f47c0cf6dd9f34ca746201894a32dd7.tar.gz snap-byow-3dbe001d6f47c0cf6dd9f34ca746201894a32dd7.zip | |
fix List::length to work with stored CS10 projects
Diffstat (limited to 'lists.js')
| -rw-r--r-- | lists.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -195,11 +195,11 @@ List.prototype.length = function () { if (this.isLinked) { var pair = this, result = 0; - while (pair.isLinked) { + while (pair && pair.isLinked) { result += 1; pair = pair.rest; } - return result + pair.contents.length; + return result + (pair ? pair.contents.length : 0); } return this.contents.length; }; |
