rem: var selection = editor.selection; if (!selection) return null; 
add: try { var selection = editor.selection; if (!selection) return null; } catch (e) { return null; } 
context: function GetSelectionContainer(){  var editor = GetCurrentEditor();  if (!editor) return null;  var selection = editor.selection;  if (!selection) return null;  var result = { oneElementSelected:false };  if (selection.isCollapsed) {    result.node = selection.focusNode;  }  else {    var rangeCount = selection.rangeCount;    if (rangeCount == 1) {      result.node = editor.getSelectedElement("");      var range = selection.getRangeAt(0);      // check for a weird case : when we select a piece of text inside      // a text node and apply an inline style to it, the selection starts      // at the end of the text node preceding the style and ends after the      // last char of the style. Assume the style element is selected for      // user's pleasure      if (!result.node &&          range.startContainer.nodeType == Node.TEXT_NODE &&          range.startOffset == range.startContainer.length &&          range.endContainer.nodeType == Node.TEXT_NODE &&          range.endOffset == range.endContainer.length &&          range.endContainer.nextSibling == null &&          range.startContainer.nextSibling == range.endContainer.parentNode)        result.node = range.endContainer.parentNode;      if (!result.node) {        // let's rely on the common ancestor of the selection        result.node = range.commonAncestorContainer;      }      else {        result.oneElementSelected = true;      }    }    else {      // assume table cells !      var i, container = null;      for (i = 0; i < rangeCount; i++) {        range = selection.getRangeAt(i);        if (!container) {          container = range.startContainer;        }        else if (container != range.startContainer) {          // all table cells don't belong to same row so let's          // select the parent of all rows          result.node = container.parentNode;          break;        }        result.node = container;      }    }  }  // make sure we have an element here  while (result.node.nodeType != Node.ELEMENT_NODE)    result.node = result.node.parentNode;  // and make sure the element is not a special editor node like  // the <br> we insert in blank lines  while (result.node.hasAttribute("_moz_editor_bogus_node"))    result.node = result.node.parentNode;  return result;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/16d402e79574cc7bb0144958a301468437d318a9/editor.js/clean/editor/ui/composer/content/editor.js