Skip to content

Commit

Permalink
Merge pull request #2292 from wordpress-mobile/fix/1910-media-upload-…
Browse files Browse the repository at this point in the history
…response-npe

Fix: Missing file extension on media upload response causes NPE
  • Loading branch information
renanferrari authored Feb 15, 2022
2 parents 39d1d0c + 8c42055 commit b9a7145
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class MimeTypes {
return expected.any { mimeType -> mimeType.subtypes.any { print(mimeType.type, it) == type } }
}

fun getMimeTypeForExtension(extension: String): String? {
fun getMimeTypeForExtension(extension: String?): String? {
return (imageTypes + videoTypes + audioTypes + documentTypes).find { it.extensions.contains(extension) }
?.toString()
}
Expand Down

0 comments on commit b9a7145

Please sign in to comment.