diff --git a/libempathy/empathy-tls-verifier.c b/libempathy/empathy-tls-verifier.c
index ca17261..f4a8fe9 100644
--- a/libempathy/empathy-tls-verifier.c
+++ b/libempathy/empathy-tls-verifier.c
@@ -288,7 +288,7 @@ real_start_verification (EmpathyTLSVerifier *self)
     }
 
   res = verify_last_certificate (self,
-      g_ptr_array_index (priv->cert_chain, num_certs - 1),
+      g_ptr_array_index (priv->cert_chain, priv->cert_chain->len - 1),
       &reason);
 
   DEBUG ("Last verification gave result %d with reason %u", res, reason);
