Skip to content

Commit 0ef117f

Browse files
committed
fix: CloseAssociation null guard and MinContextSlot type (CodeRabbit review)
1 parent 08a870d commit 0ef117f

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

Runtime/codebase/SolanaMobileStack/JsonRpcClient/JsonRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public class SignAndSendOptions
148148
{
149149
[JsonProperty("min_context_slot", NullValueHandling = NullValueHandling.Ignore)]
150150
[RequiredMember]
151-
public int? MinContextSlot { get; set; }
151+
public ulong? MinContextSlot { get; set; }
152152

153153
[JsonProperty("commitment", NullValueHandling = NullValueHandling.Ignore)]
154154
[RequiredMember]

Runtime/codebase/SolanaMobileStack/LocalAssociationScenario.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,15 @@ private void HandleEncryptedSessionPayload(byte[] e)
178178
catch (Exception ex)
179179
{
180180
Debug.LogError($"{TAG} HandleEncryptedSessionPayload | FATAL type={ex.GetType().Name} msg={ex.Message} encrypted_len={e.Length} port={_port} stack={ex.StackTrace}");
181-
try { CloseAssociation(null); } catch (Exception) { }
181+
try { CloseAssociation(new Response<object>
182+
{
183+
JsonRpc = "2.0",
184+
Error = new Response<object>.ResponseError
185+
{
186+
Code = -3,
187+
Message = $"Session payload error: {ex.Message}"
188+
}
189+
}); } catch (Exception) { }
182190
}
183191
}
184192

0 commit comments

Comments
 (0)