diff --git a/src/vte.cc b/src/vte.cc
index 48304d6c..171cfcb6 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -5637,10 +5637,12 @@ VteTerminalPrivate::hyperlink_hilite_update(vte::view::coords const& pos)
         /* This might be different from new_hyperlink_hover_idx. If in the stream, that one contains
          * the pseudo idx VTE_HYPERLINK_IDX_TARGET_IN_STREAM and now a real idx is allocated.
          * Plus, the ring's internal belief of the hovered hyperlink is also updated. */
-        if (coords_visible)
+        if (coords_visible) {
                 m_hyperlink_hover_idx = _vte_ring_get_hyperlink_at_position(m_screen->row_data, rowcol.row(), rowcol.column(), true, &m_hyperlink_hover_uri);
-        else
+        } else {
                 m_hyperlink_hover_idx = 0;
+                m_hyperlink_hover_uri = NULL;
+        }
 
         /* Invalidate cells of the new hyperlink. Get the bounding box. */
         if (m_hyperlink_hover_idx != 0) {
