Skip to content

Commit

Permalink
Stop using destroyed fragment in pairing complete callback (#9729)
Browse files Browse the repository at this point in the history
  • Loading branch information
austinh0 authored Sep 17, 2021
1 parent 6c2c6dc commit a52731f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ class DeviceProvisioningFragment : Fragment() {
override fun onPairingComplete(code: Int) {
Log.d(TAG, "onPairingComplete: $code")

// In IP commissioning, commissioning complete will already be called at this point, and the
// next fragment will be shown. As a result, this fragment will be in a destroyed state and
// should not be operated on.
if (deviceInfo.ipAddress != null) {
return
}

if (code == STATUS_PAIRING_SUCCESS) {
childFragmentManager.beginTransaction()
.add(R.id.fragment_container, EnterNetworkFragment.newInstance(networkType))
Expand Down

0 comments on commit a52731f

Please sign in to comment.