From baddb806ce6068ed0ade6058be38ae43549bcbeb Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 14 Jun 2019 08:48:21 +0200 Subject: [PATCH] Request may be null --- lib/src/Connection.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/Connection.dart b/lib/src/Connection.dart index a2f5c20..aba06f7 100644 --- a/lib/src/Connection.dart +++ b/lib/src/Connection.dart @@ -222,7 +222,7 @@ class Connection { return ErrorResponse( error: "No connection possible...", errcode: "NO_CONNECTION", - request: resp.request); + request: resp?.request); } Map jsonResp; @@ -232,11 +232,11 @@ class Connection { return ErrorResponse( error: "No connection possible...", errcode: "MALFORMED", - request: resp.request); + request: resp?.request); } if (jsonResp.containsKey("errcode") && jsonResp["errcode"] is String) { if (jsonResp["errcode"] == "M_UNKNOWN_TOKEN") clear(); - return ErrorResponse.fromJson(jsonResp, resp.request); + return ErrorResponse.fromJson(jsonResp, resp?.request); } if (client.debug) print("[RESPONSE] ${jsonResp.toString()}");