Is there an existing issue for this?
What happened?
Unsafe JSON Decoding
-
Where: AIService.generateChatResponse
-
Issue: jsonDecode(response.body) is called without a try-catch block. If the API returns a 500 error (HTML body) or network error, the app will crash.
-
Fix: Check response.statusCode before decoding and use try-catch.
-
why?If the API returns a 500 error (HTML body) or network error, the app will crash.
@SharkyBytes Please checkout the fix here
Record