Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 964874e4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Catch NPE on network state and fall back to empty summary." into nyc-mr1-dev

parents 212a6f26 6acb7662
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -356,7 +356,11 @@ public class AccessPoint implements Comparable<AccessPoint> {
    }

    public DetailedState getDetailedState() {
        return mNetworkInfo != null ? mNetworkInfo.getDetailedState() : null;
        if (mNetworkInfo != null) {
            return mNetworkInfo.getDetailedState();
        }
        Log.w(TAG, "NetworkInfo is null, cannot return detailed state");
        return null;
    }

    public String getSavedNetworkSummary() {
@@ -798,7 +802,10 @@ public class AccessPoint implements Comparable<AccessPoint> {
                return context.getString(R.string.wifi_connected_no_internet);
            }
        }

        if (state == null) {
            Log.w(TAG, "state is null, returning empty summary");
            return "";
        }
        String[] formats = context.getResources().getStringArray((ssid == null)
                ? R.array.wifi_status : R.array.wifi_status_with_ssid);
        int index = state.ordinal();