elementor / elementor

The most advanced frontend drag & drop page builder. Create high-end, pixel perfect websites at record speeds. Any theme, any page, any design.
https://elementor.com/
GNU General Public License v3.0
6.42k stars 1.39k forks source link

Added Error Handling for Null Child in Nested Tabs Widget #25912

Open asitsonawane opened 2 weeks ago

asitsonawane commented 2 weeks ago

PR Checklist

PR Type

What kind of change does this PR introduce?

Summary

This PR can be summarized in the following changelog entry:

*This PR introduces an error handling mechanism in the nested-tabs.php file of the Elementor plugin. Previously, there was a potential for a null object error to occur when the print_element() function was called on a null object at line 1152.

Description

An explanation of what is done in this PR

*This PR introduces an error handling mechanism in the nested-tabs.php file of the Elementor plugin. Previously, there was a potential for a null object error to occur when the print_element() function was called on a null object at line 1152.

The existing code already checks if the child object at the given index exists before trying to print it. This PR enhances that check by adding an else block to handle the scenario where the child object does not exist. In such a case, an error message is logged using error_log(), providing a clear indication of what went wrong and where.

This additional error handling improves the robustness of the code and aids in debugging and error tracking by providing more detailed error information.

Please review and let me know if any changes are required.

Test instructions

This PR can be tested by following these steps:

*

Quality assurance

Fixes #

CLAassistant commented 2 weeks ago

CLA assistant check
All committers have signed the CLA.