Chongyi Zheng 970965f6d8 Fix nil dereference on error (#30740)
In both cases, the `err` is nil because of `if` checks before

Reference: #30729
2024-04-28 12:13:57 +08:00
..
2024-04-28 12:13:57 +08:00
2024-04-28 12:13:57 +08:00