[sagenb] 87/157: Fix frequent: Cannot read property 'before_replacing_word' of undefined

felix salfelder felix-guest at moszumanska.debian.org
Mon Dec 22 16:51:55 UTC 2014


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository sagenb.

commit 062a76a622b9ff788843548c8fd1e8cc2ce6a4e5
Author: Volker Braun <vbraun.name at gmail.com>
Date:   Sat Oct 4 14:41:49 2014 +0100

    Fix frequent: Cannot read property 'before_replacing_word' of undefined
---
 sagenb/data/sage/js/master.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sagenb/data/sage/js/master.js b/sagenb/data/sage/js/master.js
index fa86092..7235f76 100644
--- a/sagenb/data/sage/js/master.js
+++ b/sagenb/data/sage/js/master.js
@@ -17,10 +17,12 @@ $(function () {
 //'#worksheet_cell_list' why was it function (e) below.
         $(document)
             .on('click','.introspection, .docstring, .click-message, #worksheet_cell_list', function (e) {
-                var ds_elem = $(this).parent(), id, name, style;
+                var ds_elem = $(this).parent(), style;
 
-                id = toint(ds_elem.parent().attr('id').slice(15));
-                name = introspect[id].before_replacing_word;
+                var id = toint(ds_elem.parent().attr('id').slice(15));
+                if (!Number.isInteger(id))
+                    return;  /* not every click is on a cell */
+                var name = introspect[id].before_replacing_word;
 
                 if (name.slice(-2) === '??') {
                     // Source code.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list