File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Lagrange.Core/Internal/Services/System Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,12 @@ protected override ValueTask<FetchStrangerEventResp> Parse(ReadOnlyMemory<byte>
9191 property => property . Value
9292 ) ;
9393
94+ // Check exists
95+ if ( ! bytes . TryGetValue ( 20002 , out byte [ ] ? nicknameBytes ) )
96+ {
97+ throw new OperationException ( - 1 , "Stranger not found" ) ;
98+ }
99+
94100 // Birthday
95101 byte [ ] birthday = bytes [ 20031 ] ;
96102 int year = BinaryPrimitives . ReadUInt16BigEndian ( birthday . AsSpan ( 0 , 2 ) ) ;
@@ -99,7 +105,7 @@ protected override ValueTask<FetchStrangerEventResp> Parse(ReadOnlyMemory<byte>
99105
100106 return ValueTask . FromResult ( new FetchStrangerEventResp ( new BotStranger (
101107 response . Body . Uin ,
102- Encoding . UTF8 . GetString ( bytes [ 20002 ] ) ,
108+ Encoding . UTF8 . GetString ( nicknameBytes ) ,
103109 string . Empty , // Can't not get uid
104110 Encoding . UTF8 . GetString ( bytes [ 102 ] ) ,
105111 Encoding . UTF8 . GetString ( bytes [ 103 ] ) ,
You can’t perform that action at this time.
0 commit comments