ResoCoder / flutter-tdd-clean-architecture-course

https://resocoder.com/flutter-clean-architecture-tdd/
2.01k stars 625 forks source link

infinity from random endpoint causes crash #6

Open rosstimothy opened 5 years ago

rosstimothy commented 5 years ago

Random can return infinity, which has a null value for the number field, see json response below

{
  "text": "-Infinity is negative infinity.",
  "number": null,
  "found": true,
  "type": "trivia"
}
ResoDev commented 5 years ago

Oh, at this point, I think we can just pretend that this response doesn't occur since this is just an example app... 😅

Otherwise, you'd put appropriate logic into the InputConverter.