- Issue created by @hoanglv
- Assigned to divyansh.gupta
- Merge request !51Issue #3484260: Handle Missing $data['invalidations'][0]. → (Open) created by divyansh.gupta
- 🇮🇳India divyansh.gupta Jaipur
Hello @hoanglv,
Applied your patch and the changes looks good to me because this can solve the error as by using reset($data['invalidations']), the code will check if there is at least one element in $data['invalidations'], regardless of the key structure.
Please review. The issue occurs when $data['invalidations'] doesn't have an element at index 0, causing the token replacement to fail. By using reset($data['invalidations']) instead of $data['invalidations'][0], we ensure the first element (or default value if the array is empty) is accessed correctly. This change resolves the issue and improves the robustness of the functionality.
So changes looks good to me so moving it to RTBC.