commit | cf42d60c5309ba946ed67af508f242ba714b32a9 | [log] [tgz] |
---|---|---|
author | Steven Moreland <smoreland@google.com> | Fri Dec 30 02:39:14 2022 +0000 |
committer | Steven Moreland <smoreland@google.com> | Fri Jan 06 02:29:54 2023 +0000 |
tree | bcdfa6fc439fcebd53d81d3dcae1daa0d0401b7b | |
parent | 28b9a29e04ee32da4627318fa71abc5a63d5654e [diff] |
unregistered null callback will cause a crash later Bug: N/A Change-Id: I7acbc084d8a401817879d416f0283ca40e060069 Test: N/A
diff --git a/Tethering/src/com/android/networkstack/tethering/Tethering.java b/Tethering/src/com/android/networkstack/tethering/Tethering.java index b3ec805..e1b7016 100644 --- a/Tethering/src/com/android/networkstack/tethering/Tethering.java +++ b/Tethering/src/com/android/networkstack/tethering/Tethering.java
@@ -2407,6 +2407,9 @@ /** Unregister tethering event callback */ void unregisterTetheringEventCallback(ITetheringEventCallback callback) { + if (callback == null) { + throw new NullPointerException(); + } mHandler.post(() -> { mTetheringEventCallbacks.unregister(callback); });