You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The getBloodBanks method in BloodBankService does not currently handle the case where the API response contains no records or the records field is missing. This could lead to runtime errors or unexpected behavior when the response body is not as expected.
Expected behavior
Without proper error handling, the application may crash or behave unexpectedly if the API response structure changes or if no records are returned.
Add a check to handle cases where data['records'] is null or empty.
Return an appropriate response or an empty list when no records are found.
The text was updated successfully, but these errors were encountered:
Describe the bug
The getBloodBanks method in BloodBankService does not currently handle the case where the API response contains no records or the records field is missing. This could lead to runtime errors or unexpected behavior when the response body is not as expected.
Expected behavior
Without proper error handling, the application may crash or behave unexpectedly if the API response structure changes or if no records are returned.
Add a check to handle cases where data['records'] is null or empty.
Return an appropriate response or an empty list when no records are found.
The text was updated successfully, but these errors were encountered: