[android] - prevent null pointer when receiving connectivity change events while destroying the underlying map (#6858)
This commit is contained in:
@@ -2552,7 +2552,7 @@ public class MapView extends FrameLayout {
|
||||
// Called when an action we are listening to in the manifest has been sent
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
|
||||
if (!destroyed && intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
|
||||
boolean noConnectivity = intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
|
||||
onConnectivityChanged(!noConnectivity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user