From 6eba2100bac7fb400230e4dfdf4b662b81b891ed Mon Sep 17 00:00:00 2001 From: Omar Alshaker Date: Thu, 8 Aug 2024 17:16:03 +0200 Subject: [PATCH] Warnings: Handle missing odie-last-chat-id (#38785) --- .../jetpack-mu-wpcom/changelog/add-null-fallback-odie-chat-id | 4 ++++ .../features/help-center/class-wp-rest-help-center-odie.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/add-null-fallback-odie-chat-id diff --git a/projects/packages/jetpack-mu-wpcom/changelog/add-null-fallback-odie-chat-id b/projects/packages/jetpack-mu-wpcom/changelog/add-null-fallback-odie-chat-id new file mode 100644 index 0000000000000..d95a7ef42d8cf --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/add-null-fallback-odie-chat-id @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + + diff --git a/projects/packages/jetpack-mu-wpcom/src/features/help-center/class-wp-rest-help-center-odie.php b/projects/packages/jetpack-mu-wpcom/src/features/help-center/class-wp-rest-help-center-odie.php index 71ccf619061f3..77ab16f6c032b 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/help-center/class-wp-rest-help-center-odie.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/help-center/class-wp-rest-help-center-odie.php @@ -204,7 +204,7 @@ public function get_last_chat_id() { $projected_response = array( 'odie_chat_id' => $response->odie_chat_id, - 'odie_last_chat_id' => $response->odie_last_chat_id, + 'odie_last_chat_id' => $response->odie_last_chat_id ?? null, ); return rest_ensure_response( $projected_response );