Merge "Catch creation of NetworkRequest without NetCap" into lmp-dev
diff --git a/core/java/android/net/NetworkRequest.java b/core/java/android/net/NetworkRequest.java
index 83bdfaa..5a09b46 100644
--- a/core/java/android/net/NetworkRequest.java
+++ b/core/java/android/net/NetworkRequest.java
@@ -52,6 +52,9 @@
* @hide
*/
public NetworkRequest(NetworkCapabilities nc, int legacyType, int rId) {
+ if (nc == null) {
+ throw new NullPointerException();
+ }
requestId = rId;
networkCapabilities = nc;
this.legacyType = legacyType;