diff --git a/src/ring.cc b/src/ring.cc
index 05e938ea..2dc5a528 100644
--- a/src/ring.cc
+++ b/src/ring.cc
@@ -669,7 +669,7 @@ _vte_ring_get_hyperlink_at_position (VteRing *ring, gulong position, int col, bo
                 ring->cached_row_num = (gulong) -1;
         }
 
-        if (G_UNLIKELY (position == (gulong) -1 || col == -1)) {
+        if (G_UNLIKELY (!_vte_ring_contains(ring, position) || col == -1)) {
                 if (update_hover_idx)
                         ring->hyperlink_hover_idx = 0;
                 return 0;
