@@ -710,8 +710,8 @@ class EMLocationMessageBody extends EMMessageBody {
710710 /// @nodoc
711711 EMLocationMessageBody .fromJson ({required Map map})
712712 : super .fromJson (map: map, type: MessageType .LOCATION ) {
713- this .latitude = map["latitude" ] ?? 0.0 ;
714- this .longitude = map["longitude" ] ?? 0.0 ;
713+ this .latitude = ( map["latitude" ] ?? 0 ). toDouble () ;
714+ this .longitude = ( map["longitude" ] ?? 0 ). toDouble () ;
715715 this ._address = map["address" ];
716716 this ._buildingName = map["buildingName" ];
717717 }
@@ -865,8 +865,8 @@ class EMImageMessageBody extends EMFileMessageBody {
865865 this .thumbnailRemotePath = map["thumbnailRemotePath" ];
866866 this .thumbnailSecret = map["thumbnailSecret" ];
867867 this .sendOriginalImage = map["sendOriginalImage" ] ?? false ;
868- this .height = map["height" ];
869- this .width = map["width" ];
868+ this .height = ( map["height" ] ?? 0 ). toDouble () ;
869+ this .width = ( map["width" ] ?? 0 ). toDouble () ;
870870 this .thumbnailStatus =
871871 EMFileMessageBody .downloadStatusFromInt (map["thumbnailStatus" ]);
872872 }
@@ -879,8 +879,8 @@ class EMImageMessageBody extends EMFileMessageBody {
879879 data.add ("thumbnailRemotePath" , thumbnailRemotePath);
880880 data.add ("thumbnailSecret" , thumbnailSecret);
881881 data.add ("sendOriginalImage" , sendOriginalImage);
882- data.add ("height" , height);
883- data.add ("width" , width);
882+ data.add ("height" , height ?? 0.0 );
883+ data.add ("width" , width ?? 0.0 );
884884 data.add ("thumbnailStatus" , downloadStatusToInt (this .thumbnailStatus));
885885 return data;
886886 }
@@ -1008,8 +1008,8 @@ class EMVideoMessageBody extends EMFileMessageBody {
10081008 this .thumbnailLocalPath = map["thumbnailLocalPath" ];
10091009 this .thumbnailRemotePath = map["thumbnailRemotePath" ];
10101010 this .thumbnailSecret = map["thumbnailSecret" ];
1011- this .height = map["height" ];
1012- this .width = map["width" ];
1011+ this .height = ( map["height" ] ?? 0 ). toDouble () ;
1012+ this .width = ( map["width" ] ?? 0 ). toDouble () ;
10131013 this .thumbnailStatus =
10141014 EMFileMessageBody .downloadStatusFromInt (map["thumbnailStatus" ]);
10151015 }
@@ -1022,8 +1022,8 @@ class EMVideoMessageBody extends EMFileMessageBody {
10221022 data.add ("thumbnailLocalPath" , thumbnailLocalPath);
10231023 data.add ("thumbnailRemotePath" , thumbnailRemotePath);
10241024 data.add ("thumbnailSecret" , thumbnailSecret);
1025- data.add ("height" , height);
1026- data.add ("width" , width);
1025+ data.add ("height" , height ?? 0.0 );
1026+ data.add ("width" , width ?? 0.0 );
10271027 data.add ("thumbnailStatus" , downloadStatusToInt (this .thumbnailStatus));
10281028
10291029 return data;
0 commit comments