Skip to content

Commit

Permalink
fix(pose detection): use safe call in pose detection frame processor …
Browse files Browse the repository at this point in the history
…for null safety (#151)
  • Loading branch information
holakmateusz authored Oct 14, 2024
1 parent ac145bd commit 43e963d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PoseDetectionFrameProcessorPlugin() : FrameProcessorPlugin() {
}

override fun callback(frame: Frame, params: MutableMap<String, Any>?): Any? {
val detectorHandle: Double = params!!["detectorHandle"] as Double
val detectorHandle = (params?.get("detectorHandle") as? Double) ?: return false
val detector = PoseDetectorMap.detectorMap[detectorHandle.toInt()] ?: return false
val orientation = params["orientation"] as String
val mappedOrientation = imageOrientation(orientation)
Expand Down

0 comments on commit 43e963d

Please sign in to comment.