From 1e107b0fce48e8f5286c16571af6f6500790c98c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 22 May 2006 12:35:18 +0100 Subject: [PATCH] override die on error --- db-prefs.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/db-prefs.php b/db-prefs.php index a33dee80..519b35f2 100644 --- a/db-prefs.php +++ b/db-prefs.php @@ -7,7 +7,7 @@ $_SESSION["prefs_cache"] = array(); } - function get_pref($link, $pref_name, $user_id = false) { + function get_pref($link, $pref_name, $user_id = false, $die_on_error = true) { $pref_name = db_escape_string($pref_name); @@ -49,7 +49,11 @@ return convert_pref_type($value, $type_name); } else { - die("Fatal error, unknown preferences key: $pref_name"); + if ($die_on_error) { + die("Fatal error, unknown preferences key: $pref_name"); + } else { + return null; + } } } -- 2.39.5