This is an automated backport of #6958: Fix coverity warning about null pointer dereference.
This PR will be merged automatically after all the relevant CI checks pass. If this fix should not be backported, or will be backported manually, just close this PR. You can use the backport branch to add your changes, it won't be modified automatically anymore.
Fix coverity warning about null pointer dereference
While the coverity warning is a false positive since rte->relkind is always either RELKIND_RELATION or RELKIND_VIEW this might not hold always true. This patch changes the if check to an Ensure and removes some nesting in the function.
This is an automated backport of #6958: Fix coverity warning about null pointer dereference. This PR will be merged automatically after all the relevant CI checks pass. If this fix should not be backported, or will be backported manually, just close this PR. You can use the backport branch to add your changes, it won't be modified automatically anymore.
For more details, please see the documentation
Original description
Fix coverity warning about null pointer dereference
While the coverity warning is a false positive since rte->relkind is always either RELKIND_RELATION or RELKIND_VIEW this might not hold always true. This patch changes the if check to an Ensure and removes some nesting in the function.
Disable-check: force-changelog-file