am f0bbc494: Merge "Avoid NPE when missing network stats." into ics-mr1
* commit 'f0bbc494d638f4c77e688bf9410027f453301559':
Avoid NPE when missing network stats.
diff --git a/services/java/com/android/server/net/NetworkStatsService.java b/services/java/com/android/server/net/NetworkStatsService.java
index 871ed68..f660520 100644
--- a/services/java/com/android/server/net/NetworkStatsService.java
+++ b/services/java/com/android/server/net/NetworkStatsService.java
@@ -1060,8 +1060,10 @@
}
// clear UID from current stats snapshot
- mLastPollUidSnapshot = mLastPollUidSnapshot.withoutUid(uid);
- mLastPollNetworkXtSnapshot = computeNetworkXtSnapshotFromUid(mLastPollUidSnapshot);
+ if (mLastPollUidSnapshot != null) {
+ mLastPollUidSnapshot = mLastPollUidSnapshot.withoutUid(uid);
+ mLastPollNetworkXtSnapshot = computeNetworkXtSnapshotFromUid(mLastPollUidSnapshot);
+ }
// clear kernel stats associated with UID
resetKernelUidStats(uid);