summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-01-09 14:30:56 +0000
committeralecpl <alec@alec.pl>2012-01-09 14:30:56 +0000
commitd741a96ecdde5a2b1a454e6b9a324350e7316525 (patch)
tree8b350cddfb545f69c00803cbb92e23694eae5274
parent1adc70526c5de788da982d3d2de26fde7133b543 (diff)
- Fix error when calling remove_row() on non-existing row
-rw-r--r--program/js/list.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/program/js/list.js b/program/js/list.js
index ff0544f14..70770acb0 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -182,8 +182,12 @@ clear: function(sel)
*/
remove_row: function(uid, sel_next)
{
- if (this.rows[uid].obj)
- this.rows[uid].obj.style.display = 'none';
+ var obj = this.rows[uid] ? this.rows[uid].obj : null;
+
+ if (!obj)
+ return;
+
+ obj.style.display = 'none';
if (sel_next)
this.select_next();