diff --git a/lib/curse.js b/lib/curse.js
index <HASH>..<HASH> 100644
--- a/lib/curse.js
+++ b/lib/curse.js
@@ -40,6 +40,11 @@ Curse.prototype.capture = function capture() {
   var focOff = sel.focusOffset;
   var child, start, end;
 
+  if (anc === null || foc === null) {
+    this.reset();
+    return;
+  }
+
   if (anc.nodeName === '#text') {
     start = this.lengthUpTo(anc) + ancOff;
   } else {
Reset curse on #capture if there is no selection