diff --git a/abilian/web/resources/scribe/scribe/scribe.js b/abilian/web/resources/scribe/scribe/scribe.js
index <HASH>..<HASH> 100644
--- a/abilian/web/resources/scribe/scribe/scribe.js
+++ b/abilian/web/resources/scribe/scribe/scribe.js
@@ -3795,6 +3795,9 @@ function (elementHelper) {
     }
 
     Selection.prototype.getContaining = function (nodeFilter) {
+      var range = this.range;
+      if (!range) { return; }
+
       var node = new scribe.api.Node(this.range.commonAncestorContainer);
       var isTopContainerElement = node.node && node.node.attributes
          && node.node.attributes.getNamedItem('contenteditable');
@@ -4593,4 +4596,4 @@ define('scribe',[
 
 });
 
-//# sourceMappingURL=scribe.js.map
\ No newline at end of file
+//# sourceMappingURL=scribe.js.map
scribe.js: backport upstream fix