Skip to content

Commit

Permalink
fix: prevent null exception
Browse files Browse the repository at this point in the history
  • Loading branch information
sashatalalasha committed Oct 16, 2023
1 parent ce12100 commit 3719abd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flutter-ory-network/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Future<void> main() async {
'Accept': 'application/json',
},
validateStatus: (status) {
// here we prevent the request from throwing an error when the status code is less than 500 (internal server error)
return status! < 500;
// prevent the request from throwing null exception
return status != null && status < 500 ? true : false;
},
);
final dio = DioForNative(options);
Expand Down

0 comments on commit 3719abd

Please sign in to comment.