Skip to content

Commit

Permalink
Fix surface causing null pointer exception on some devices (#544)
Browse files Browse the repository at this point in the history
* Fix surface null pointer exception

* Add changeset

* Call willNotProvideSurface when surface is null
  • Loading branch information
KasemJaffer authored Nov 26, 2024
1 parent 2237525 commit 4052700
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/small-beds-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"client-sdk-android": patch
---

Fix surface causing null pointer exception on some devices
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ internal constructor(

surface = Surface(surfaceTextureHelper.surfaceTexture)
surfaceProvider = SurfaceProvider { request ->
request.provideSurface(surface!!, helperExecutor) { }
surface?.let {
request.provideSurface(it, helperExecutor) { }
} ?: request.willNotProvideSurface()
}

// Set image analysis - camera params
Expand Down

0 comments on commit 4052700

Please sign in to comment.