Safeguard against NPE race condition.

It is possible for the main activity to be quit before the posted
message is executed, safeguard against NPEs in this scenario.

Bug: 73484470
Test: runtest --path frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.jav
Change-Id: I34b40089ef2eae213c804e4e379d6ab7825bbceb
(cherry picked from commit 5d14fd7b657c9cc2ece5507b96d47a2a0e5b3e25)
1 file changed