From 9457bb090aba5c9134fb001b2ba41fe32a8c66b8 Mon Sep 17 00:00:00 2001
From: Andrew Dolgov <noreply@fakecake.org>
Date: Sun, 5 Jun 2022 11:14:42 +0300
Subject: [PATCH] fix PHP8 undefined array key warning when resetting prefs to
 defaults

---
 classes/pref/prefs.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index 2d72a7732..8c044b49f 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -275,7 +275,7 @@ class Pref_Prefs extends Handler_Protected {
 	}
 
 	function resetconfig(): void {
-		Prefs::reset($_SESSION["uid"], $_SESSION["profile"]);
+		Prefs::reset($_SESSION["uid"], $_SESSION["profile"] ?? null);
 
 		print "PREFS_NEED_RELOAD";
 	}
-- 
GitLab