Added Error Handling for Null Child in Nested Tabs Widget #25912
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #