From eafddcc40e6b3a6eb192730fc61c16c12a97766c Mon Sep 17 00:00:00 2001 From: Dik Takken Date: Tue, 11 Jun 2024 16:33:57 +0200 Subject: [PATCH] Check if object is queued for update before removing it --- includes/classes/SyncManager.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/classes/SyncManager.php b/includes/classes/SyncManager.php index 1f2e54ce3f..ea0068767f 100644 --- a/includes/classes/SyncManager.php +++ b/includes/classes/SyncManager.php @@ -131,6 +131,10 @@ public function remove_from_queue( $object_id ) { return false; } + if ( ! isset( $this->sync_queue[ $object_id ] ) ) { + return false; + } + $current_blog_id = get_current_blog_id(); if ( ! isset( $this->sync_queue[ $current_blog_id ] ) ) { $this->sync_queue[ $current_blog_id ] = [];