--- 
+++ 
@@ -26,7 +26,7 @@
             endIndex = -(endIndex + 1); // this is first item AFTER end period
             endIndex = endIndex - 1;    // so this is last item BEFORE end
         }
-        if (endIndex < 0) {
+        if (endIndex < 0 || startIndex > endIndex) {  // neither start nor before
             emptyRange = true;
         }
         if (emptyRange) {