Platform (use [x])
[x] Android
[] iOS
[] macOS
[] Windows
[] Web
Device info
Manufacture: Google
Model: Pixel 4
OS version: Android API 33
Describe the bug:
Tried to use the method CubeAttachment.fromJson of line 227 on file connectycube_sdk-2.5.5/lib/src/chat/models/cube_message.dart and it explodes reporting this error: Unhandled Exception: type 'double' is not a subtype of type 'String' on line 233 size = json['size'] != null ? double.parse(json['size']) : null; inside that method and file.
Actual result:
Method CubeAttachment.fromJson() not working properly.
Expected behavior:
Method CubeAttachment.fromJson() should work without throwing this Exception.
Additional info
I fixed it by replacing line 233 size = json['size'] != null ? double.parse(json['size']) : null; with this line of code size = json['size'] == null ? null : (json['size'] is String) ? double.parse(json['size']) : (json['size'] is double) ? json['size'] : null;.
Hope it helped :)
Please fix this bug and contact me when you merge this into a new package version so i can update it ;)
Platform (use [x]) [x] Android [] iOS [] macOS [] Windows [] Web
Device info Manufacture: Google Model: Pixel 4 OS version: Android API 33
Describe the bug: Tried to use the method
CubeAttachment.fromJson
of line 227 on fileconnectycube_sdk-2.5.5/lib/src/chat/models/cube_message.dart
and it explodes reporting this error:Unhandled Exception: type 'double' is not a subtype of type 'String'
on line 233size = json['size'] != null ? double.parse(json['size']) : null;
inside that method and file.Steps to Reproduce:
CubeAttachment.fromJson()
;Logs:
Actual result: Method
CubeAttachment.fromJson()
not working properly.Expected behavior: Method
CubeAttachment.fromJson()
should work without throwing this Exception.Additional info I fixed it by replacing line 233
size = json['size'] != null ? double.parse(json['size']) : null;
with this line of codesize = json['size'] == null ? null : (json['size'] is String) ? double.parse(json['size']) : (json['size'] is double) ? json['size'] : null;
.Hope it helped :) Please fix this bug and contact me when you merge this into a new package version so i can update it ;)