Throw correct exception for null path insert

insert should return IllegalArgumentException instead of NullPointerException

Bug: 31861145
Change-Id: I12005c9ca4ebd4ab35cebdc80352c1696f4e57d1
diff --git a/src/com/android/providers/media/MediaProvider.java b/src/com/android/providers/media/MediaProvider.java
index aa8cd88..e181e59 100644
--- a/src/com/android/providers/media/MediaProvider.java
+++ b/src/com/android/providers/media/MediaProvider.java
@@ -3214,7 +3214,7 @@
                 format = MediaFile.getFormatCode(path, mimeType);
             }
         }
-        if (path.endsWith("/")) {
+        if (path != null && path.endsWith("/")) {
             Log.e(TAG, "directory has trailing slash: " + path);
             return 0;
         }