diff --git a/PyFunceble/query/http_status_code.py b/PyFunceble/query/http_status_code.py
index <HASH>..<HASH> 100644
--- a/PyFunceble/query/http_status_code.py
+++ b/PyFunceble/query/http_status_code.py
@@ -357,7 +357,11 @@ class HTTPStatusCode:
                     req.url
                 ).get_converted()
 
-            if not self.allow_redirects and first_origin != final_origin:
+            if (
+                not self.allow_redirects
+                and first_origin != final_origin
+                and req.history
+            ):
                 return req.history[0].status_code
 
             return req.status_code
Fix issue when the history is empty.

Indeed, in some rare cases, the history may be empty.
This patch fixes the issue by checking if the history is filled with data.

Contributors:
  * @mitchellkrogza