Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

asitsonawane
Copy link

@asitsonawane asitsonawane commented Apr 29, 2024

PR Checklist

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

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

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended
  • Docs have been added / updated (for bug fixes / features)

Fixes #

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.
@CLAassistant
Copy link

CLAassistant commented Apr 29, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants