You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This line in DeviceMetadata.java is causing me an error:
/** * @param context * @return The current network type. */staticStringgetNetworkType(Contextcontext) {
ConnectivityManagerconnectivityManager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
returnconnectivityManager.getActiveNetworkInfo().getTypeName();
}
Error message:
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.NetworkInfo.getTypeName()' on a null object reference
at com.braintreepayments.api.DeviceMetadata.getNetworkType(DeviceMetadata.java:81)
at com.braintreepayments.api.AnalyticsManager.generateMetadata(AnalyticsManager.java:157)
at com.braintreepayments.api.AnalyticsManager.processRequests(AnalyticsManager.java:131)
at com.braintreepayments.api.AnalyticsManager.access$000(AnalyticsManager.java:28)
at com.braintreepayments.api.AnalyticsManager$2.onConfigurationFetched(AnalyticsManager.java:92)
at com.braintreepayments.api.BraintreeFragment$7.run(BraintreeFragment.java:424)
at com.braintreepayments.api.BraintreeFragment.postOrQueueCallback(BraintreeFragment.java:356)
at com.braintreepayments.api.BraintreeFragment.waitForConfiguration(BraintreeFragment.java:416)
at com.braintreepayments.api.AnalyticsManager.flushEvents(AnalyticsManager.java:88)
at com.braintreepayments.api.BraintreeFragment.onPause(BraintreeFragment.java:183)
at android.app.Fragment.performPause(Fragment.java:2379)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1019)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1130)
at android.app.FragmentManagerImpl.dispatchPause(FragmentManager.java:1967)
at android.app.FragmentController.dispatchPause(FragmentController.java:185)
at android.app.Activity.performPause(Activity.java:6357)
at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1412)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3614)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3579)
at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3547)
at android.app.ActivityThread.access$1100(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:168)
at android.app.ActivityThread.main(ActivityThread.java:5845)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
I think getActiveNetworkInfo() will be null in some cases.
/** * Return NetworkInfo for the active (i.e., connected) network interface. * It is assumed that at most one network is active at a time. If more * than one is active, it is indeterminate which will be returned. * @return the info for the active network, or {@code null} if none is active */publicNetworkInfogetActiveNetworkInfo() {
enforceAccessPermission();
for (NetworkStateTrackert : mNetTrackers) {
NetworkInfoinfo = t.getNetworkInfo();
if (info.isConnected()) {
returninfo;
}
}
returnnull;
}
The text was updated successfully, but these errors were encountered:
@elainedizon thank you for the report. I've made a fix on both 1.x and 2.x versions. The fix for 2.x should go out today along with some other changes, 1.x should be out in the next week or two.
This line in DeviceMetadata.java is causing me an error:
Error message:
I think getActiveNetworkInfo() will be null in some cases.
The text was updated successfully, but these errors were encountered: