Skip to content

Commit 645e884

Browse files
authored
Merge pull request #6 from weixuefeng/main
Fix: Unhandled Exception: MessageException(Invalid type. type: int?, Excepted: _BigIntImpl)
2 parents cbf9feb + 0209e1e commit 645e884

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/src/protobuf/codec/decoder.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ extension QuickProtocolBufferResult on ProtocolBufferDecoderResult {
158158
return (value == 1 ? true : false) as T;
159159
}
160160
}
161+
if(0 is T && value is BigInt) {
162+
return (value as BigInt).toInt() as T;
163+
}
161164
throw MessageException("Invalid type.",
162165
details: {"type": "$T", "Excepted": value.runtimeType.toString()});
163166
}

0 commit comments

Comments
 (0)