From 51a2d45578d5baae33b4d37af9915da279571752 Mon Sep 17 00:00:00 2001 From: Konstantin Kovshenin Date: Mon, 28 Aug 2017 10:53:48 +0300 Subject: [PATCH] Helper: Make sure transients are not empty before setting again. --- includes/admin/helper/class-wc-helper-updater.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/admin/helper/class-wc-helper-updater.php b/includes/admin/helper/class-wc-helper-updater.php index 297ae24fb5b..f1dc542d204 100644 --- a/includes/admin/helper/class-wc-helper-updater.php +++ b/includes/admin/helper/class-wc-helper-updater.php @@ -291,8 +291,15 @@ class WC_Helper_Updater { delete_transient( '_woocommerce_helper_updates_count' ); // Refresh update transients - set_site_transient( 'update_plugins', get_site_transient( 'update_plugins' ) ); - set_site_transient( 'update_themes', get_site_transient( 'update_themes' ) ); + $update_plugins = get_site_transient( 'update_plugins' ); + if ( ! empty( $update_plugins ) ) { + set_site_transient( 'update_plugins', $update_plugins ); + } + + $update_themes = get_site_transient( 'update_themes' ); + if ( ! empty( $update_themes ) ) { + set_site_transient( 'update_themes', $update_themes ); + } } /**