Skip to content

Commit

Permalink
Provide help when FileProvider not defined right
Browse files Browse the repository at this point in the history
Fixes #2081
  • Loading branch information
pyricau committed Mar 26, 2021
1 parent 295f948 commit a9a9f31
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,10 @@ internal class LeakCanaryFileProvider : ContentProvider() {
val strat = SimplePathStrategy(authority)

val info = context.packageManager
.resolveContentProvider(authority, PackageManager.GET_META_DATA)!!
.resolveContentProvider(authority, PackageManager.GET_META_DATA)
?: throw IllegalArgumentException(
"Couldn't find meta-data for provider with authority $authority"
)
val resourceParser = info.loadXmlMetaData(
context.packageManager, META_DATA_FILE_PROVIDER_PATHS
) ?: throw IllegalArgumentException(
Expand Down

0 comments on commit a9a9f31

Please sign in to comment.