File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -97,14 +97,14 @@ class Client {
9797 throw {{spec .title | caseUcfirst }}Exception(e.message);
9898 }
9999 if(responseType == ResponseType.bytes) {
100- if(e.response!.headers['content-type'].contains('application/json')) {
100+ if(e.response!.headers['content-type']? .contains('application/json') ?? false ) {
101101 final res = json.decode(utf8.decode(e.response!.data));
102102 throw {{spec .title | caseUcfirst }}Exception(res['message'],res['code'], res);
103103 } else {
104104 throw {{spec .title | caseUcfirst }}Exception(e.message);
105105 }
106106 }
107- throw {{spec .title | caseUcfirst }}Exception(e.response.data['message'],e.response.data['code'], e.response.data);
107+ throw {{spec .title | caseUcfirst }}Exception(e.response? .data['message'],e.response? .data['code'], e.response? .data);
108108 } catch(e) {
109109 throw {{spec .title | caseUcfirst }}Exception(e.toString());
110110 }
You can’t perform that action at this time.
0 commit comments