We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 890e2fb commit 1b80a50Copy full SHA for 1b80a50
aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/http/HttpClientConnectionNative.kt
@@ -142,8 +142,8 @@ private fun onIncomingBody(
142
data: CPointer<aws_byte_cursor>?,
143
userdata: COpaquePointer?,
144
): Int {
145
- val stableRef = userdata?.asStableRef<HttpStreamContext>()
146
- val ctx = stableRef?.get()
+ val stableRef = try { userdata?.asStableRef<HttpStreamContext>() } catch (_: NullPointerException) { return AWS_OP_ERR }
+ val ctx = try { stableRef?.get() } catch (_: NullPointerException) { return AWS_OP_ERR }
147
if (ctx == null) return AWS_OP_ERR
148
val stream = ctx.stream
149
if (stream == null) return AWS_OP_ERR
0 commit comments