6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 77e95064

AuthorMikkel Thygesen<mth@dwarf.dk>
Date2025-02-12 09:21:43 +0100
455: Fixed null pointer error

Changed files

.../lib/services/interceptors/response_handle_interceptor.dart         | 3 ++-
 comwell_key_app/pubspec.yaml                                           | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Diff

diff --git a/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart b/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
index aff49c3c..e78d74d0 100644
--- a/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
+++ b/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
@@ -42,7 +42,8 @@ class ResponseHandleInterceptor extends Interceptor {
@override
Future<dynamic> onError(
DioException err, ErrorInterceptorHandler handler) async {
- final response = err.response!;
+ final response = err.response;
+ if (response == null) throw Exception("Missing response");
final statusCode = response.statusCode;
try {
if (response.data == null) {
diff --git a/comwell_key_app/pubspec.yaml b/comwell_key_app/pubspec.yaml
index fc07fce7..cfb93de1 100644
--- a/comwell_key_app/pubspec.yaml
+++ b/comwell_key_app/pubspec.yaml
@@ -2,7 +2,7 @@ name: comwell_key_app
description: This app needs a description
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
-version: 0.0.1+10
+version: 0.0.1+12
environment:
sdk: '>=3.0.0 <3.25.0'