Skip to content

Commit

Permalink
Fixing issue google-ai-edge#39 - late init race condition for helper …
Browse files Browse the repository at this point in the history
…and dropdown menu
  • Loading branch information
PaulTR committed Jan 19, 2023
1 parent 445a7da commit 5b8f9ee
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,12 @@ class CameraFragment : Fragment(), HandLandmarkerHelper.LandmarkerListener {
override fun onItemSelected(
p0: AdapterView<*>?, p1: View?, p2: Int, p3: Long
) {
handLandmarkerHelper.currentDelegate = p2
updateControlsUi()
try {
handLandmarkerHelper.currentDelegate = p2
updateControlsUi()
} catch(e: UninitializedPropertyAccessException) {
Log.e(TAG, "HandLandmarkerHelper has not been initialized yet.")
}
}

override fun onNothingSelected(p0: AdapterView<*>?) {
Expand Down

0 comments on commit 5b8f9ee

Please sign in to comment.