Skip to content

Commit d238ee7

Browse files
Show what went wrong in the exception
1 parent 206769a commit d238ee7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

patches/src/main/kotlin/app/revanced/util/ResourceUtils.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@ fun ResourcePatchContext.copyResources(
7070
for (resourceGroup in resources) {
7171
resourceGroup.resources.forEach { resource ->
7272
val resourceFile = "${resourceGroup.resourceDirectoryName}/$resource"
73+
val stream = inputStreamFromBundledResource(sourceResourceDirectory, resourceFile)
74+
if (stream == null) {
75+
throw IllegalArgumentException("Could not find resource: $resourceFile " +
76+
"in directory: $sourceResourceDirectory")
77+
}
7378
Files.copy(
74-
inputStreamFromBundledResource(sourceResourceDirectory, resourceFile)!!,
79+
stream,
7580
targetResourceDirectory.resolve(resourceFile).toPath(),
7681
StandardCopyOption.REPLACE_EXISTING,
7782
)

0 commit comments

Comments
 (0)