From edad723dc0f6d5a47021bf0c94235daf60aac2e5 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Thu, 8 Feb 2024 13:44:27 -0600 Subject: [PATCH] Fix an uninitialized value used in pattern match. This is caused by trying to match the problem flags with `/:needs_grading$/' when there isn't a real problem. For instance when a set info file is rendered. --- lib/WeBWorK/Utils/Rendering.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WeBWorK/Utils/Rendering.pm b/lib/WeBWorK/Utils/Rendering.pm index 9bc6d69e67..474936d49a 100644 --- a/lib/WeBWorK/Utils/Rendering.pm +++ b/lib/WeBWorK/Utils/Rendering.pm @@ -127,7 +127,7 @@ sub constructPGOptions ($ce, $user, $set, $problem, $psvn, $formFields, $transla $options{num_of_incorrect_ans} = $problem->num_incorrect; # This means that there are essay questions in the problem that have not been graded. - $options{needs_grading} = $problem->flags =~ /:needs_grading$/; + $options{needs_grading} = ($problem->flags // '') =~ /:needs_grading$/; # Persistent problem data $options{PERSISTENCE_HASH} = decode_json($problem->problem_data || '{}');