exception in messages page

Issue #141 closed
dd1 created an issue

The messages page throws an exception in line 136 of msg_prepend():

My copy of the function reads this:

function msg_prepend(msg) { var mf = document.getElementById('messageFrame');

  for (var i = 0; i < msg.length; i++) {
     var line = msg[i];
     var t = parseInt(line);

     if (line.indexOf(" ") && (t > 0 || t == -1))
        line = line.substr(line.indexOf(" ") + 1);
     var e = document.createElement("p");
     e.className = "mmessageline";
     e.appendChild(document.createTextNode(line));

     if (e.innerHTML == mf.childNodes[1 + i].innerHTML)
        break;

...

This last "if" statement is where the exception is thrown. I guess "mf.childNodes[1+i] is null, I do not see check for "i" compared to the size of mf.childNodes[].

I see the debugger reporting: i is set to 0, mf.childNodes[] has 1 entry, and it seems to be a table header. so we do overrun this array.

K.O.

Comments (1)

  1. Stefan Ritt

    I tried hard but could not reproduce the problem. Probably has to do with slow network connections over the Atlantic. Anyhow I added some code to prevent this exception. So give it a try.

  2. Log in to comment