From de328e5971be3247eb50b1cfb2645456f584bf8e Mon Sep 17 00:00:00 2001
From: Brian Lin <lin.brian.l@gmail.com>
Date: Wed, 20 Jul 2022 15:01:47 -0500
Subject: [PATCH] PODB-603: Protect against client ID being null.

---
 src/LtiMessageLaunch.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/LtiMessageLaunch.php b/src/LtiMessageLaunch.php
index ff816b64..b34d580a 100644
--- a/src/LtiMessageLaunch.php
+++ b/src/LtiMessageLaunch.php
@@ -283,8 +283,13 @@ public function getLaunchId()
         return $this->launch_id;
     }
 
-    public static function getMissingRegistrationErrorMsg(string $issuerUrl, string $clientId): string
+    public static function getMissingRegistrationErrorMsg(string $issuerUrl, ?string $clientId = null): string
     {
+        // Guard against client ID being null
+        if (!isset($clientId)) {
+            $clientId = '(N/A)';
+        }
+
         $search = [':issuerUrl', ':clientId'];
         $replace = [$issuerUrl, $clientId];