Skip to content

Commit

Permalink
Merge pull request #6 from weixuefeng/main
Browse files Browse the repository at this point in the history
Fix: Unhandled Exception: MessageException(Invalid type. type: int?, Excepted: _BigIntImpl)
  • Loading branch information
mrtnetwork authored Jan 2, 2025
2 parents cbf9feb + 0209e1e commit 645e884
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/protobuf/codec/decoder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ extension QuickProtocolBufferResult on ProtocolBufferDecoderResult {
return (value == 1 ? true : false) as T;
}
}
if(0 is T && value is BigInt) {
return (value as BigInt).toInt() as T;
}
throw MessageException("Invalid type.",
details: {"type": "$T", "Excepted": value.runtimeType.toString()});
}
Expand Down

0 comments on commit 645e884

Please sign in to comment.