unregistered null callback will cause a crash later

Bug: N/A
Change-Id: I7acbc084d8a401817879d416f0283ca40e060069
Test: N/A
This commit is contained in:
Steven Moreland 2022-12-30 02:39:14 +00:00
commit cf42d60c53

View file

@ -2407,6 +2407,9 @@ public class Tethering {
/** Unregister tethering event callback */
void unregisterTetheringEventCallback(ITetheringEventCallback callback) {
if (callback == null) {
throw new NullPointerException();
}
mHandler.post(() -> {
mTetheringEventCallbacks.unregister(callback);
});