Title: Fatal PHP error
Last modified: November 21, 2023

---

# Fatal PHP error

 *  Resolved [daneshh](https://wordpress.org/support/users/daneshh/)
 * (@daneshh)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-php-error-37/)
 * Hello,
 * when I want to save a product this plugin makes a fatal error. (the product has
   variations)
 * Debug.log :
 *     ```wp-block-code
       [21-Nov-2023 10:49:35 UTC] PHP Fatal error: Uncaught Error: Call to a member function update_meta_data() on bool in /var/www/html/wordpress/wp-content/plugins/license-manager-for-woocommerce/includes/Integrations/WooCommerce/ProductData.php:229
       Stack trace:
   
       0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(326): LicenseManagerForWooCommerce\Integrations\WooCommerce\ProductData->savePost()
   
       1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
   
       2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
   
       3 /var/www/html/wordpress/wp-includes/post.php(4760): do_action()
   
       4 /var/www/html/wordpress/wp-includes/revision.php(380): wp_insert_post()
   
       5 /var/www/html/wordpress/wp-includes/revision.php(217): _wp_put_post_revision()
   
       6 /var/www/html/wordpress/wp-includes/revision.php(116): wp_save_post_revision()
   
       7 /var/www/html/wordpress/wp-includes/class-wp-hook.php(326): wp_save_post_revision_on_insert()
   
       8 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
   
       9 /var/www/h in /var/www/html/wordpress/wp-content/plugins/license-manager-for-woocommerce/includes/Integrations/WooCommerce/ProductData.php on line 229
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Mirza Hamza](https://wordpress.org/support/users/hamza1010/)
 * (@hamza1010)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-php-error-37/#post-17218233)
 * Hello [@daneshh](https://wordpress.org/support/users/daneshh/),
 * Thanks for contacting us,
 * Hope you are doing well, We’ve informed our technical team about your issue, 
   and they will work on it promptly. When we receive their response, we will get
   back to you. Our team is here to assist you.
 * Thanks & Regards
   WP Experts Support Team
 *  Plugin Support [Mirza Hamza](https://wordpress.org/support/users/hamza1010/)
 * (@hamza1010)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-php-error-37/#post-17221185)
 * Hello [@daneshh](https://wordpress.org/support/users/daneshh/),
 * You have to go to this file. Here is the file path **wp-content\plugins\license-
   manager-for-woocommerce\includes\Integrations\WooCommerce\ProductData.php** and
   then add this code in the savePost function.
 * Here is the code:
 *     ```wp-block-code
        if ( ! is_object( $product ) ) {
               return;
         }
       ```
   
 * Please check it and let me know if you still have any issues.
 * Thank you
 *  Thread Starter [daneshh](https://wordpress.org/support/users/daneshh/)
 * (@daneshh)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-php-error-37/#post-17221444)
 * Hi.
 * thanks for checking.
 * should I add the if condition at the beginning of the savePost function?
 * like this ?
 *     ```wp-block-code
       public function savePost($postId)
           {
               if ( ! is_object( $product ) ) {
                   return;
               }
               // This is not a product.
               if (!array_key_exists('post_type', $_POST)
       ...
       ```
   
 *  Plugin Support [Mirza Hamza](https://wordpress.org/support/users/hamza1010/)
 * (@hamza1010)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-php-error-37/#post-17226849)
 * Hello [@daneshh](https://wordpress.org/support/users/daneshh/),
 * To escalate your case, please create a ticket on our official website so that
   we can connect you directly with our Technical team.
 * Looking forward to getting your issue resolved.
 * Thank you

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fatal PHP error’ is closed to new replies.

 * ![](https://ps.w.org/license-manager-for-woocommerce/assets/icon-256x256.gif?
   rev=2824216)
 * [License Manager for WooCommerce](https://wordpress.org/plugins/license-manager-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/license-manager-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/license-manager-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/license-manager-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/license-manager-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/license-manager-for-woocommerce/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Mirza Hamza](https://wordpress.org/support/users/hamza1010/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/fatal-php-error-37/#post-17226849)
 * Status: resolved