Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e633b409 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Avoid NullPointerException on non-existing file." am: 5db706a4 am:...

Merge "Avoid NullPointerException on non-existing file." am: 5db706a4 am: 2cf1c81e am: 9328409c

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1488698

Change-Id: Iebdb59ab2cb0db26a2ff5106b9ef030ad5131704
parents e7fe5231 9328409c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ public class SystemPreparer extends ExternalResource {
    private File copyResourceToTemp(String resourcePath) throws IOException {
        final File tempFile = mHostTempFolder.newFile();
        final ClassLoader classLoader = getClass().getClassLoader();
        try (InputStream assetIs = classLoader.getResource(resourcePath).openStream();
        try (InputStream assetIs = classLoader.getResourceAsStream(resourcePath);
             FileOutputStream assetOs = new FileOutputStream(tempFile)) {
            if (assetIs == null) {
                throw new IllegalStateException("Failed to find resource " + resourcePath);