diff --git a/settings.php b/settings.php
index c8cbe922..a17309e3 100644
--- a/settings.php
+++ b/settings.php
@@ -14,7 +14,7 @@ $piholeFTLConf = piholeFTLConfig();
// Handling of PHP internal errors
$last_error = error_get_last();
-if($last_error["type"] === E_WARNING || $last_error["type"] === E_ERROR)
+if(isset($last_error) && ($last_error["type"] === E_WARNING || $last_error["type"] === E_ERROR))
{
$error .= "There was a problem applying your settings.
Debugging information:
PHP error (".htmlspecialchars($last_error["type"])."): ".htmlspecialchars($last_error["message"])." in ".htmlspecialchars($last_error["file"]).":".htmlspecialchars($last_error["line"]);
}