From 3719abdeb78962faac5a838b418dde402299b619 Mon Sep 17 00:00:00 2001 From: Alexandra Talalaieva <25621530+sashatalalasha@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:00:39 +0200 Subject: [PATCH] fix: prevent null exception --- flutter-ory-network/lib/main.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter-ory-network/lib/main.dart b/flutter-ory-network/lib/main.dart index ea93cfc..2ece2df 100644 --- a/flutter-ory-network/lib/main.dart +++ b/flutter-ory-network/lib/main.dart @@ -29,8 +29,8 @@ Future 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);