瀏覽代碼

Null check for local source cover parent dir

arkon 4 年之前
父節點
當前提交
573f3a392a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt

@@ -45,7 +45,7 @@ class LocalSource(private val context: Context) : CatalogueSource {
             val cover = File("${dir.absolutePath}/${manga.url}", COVER_NAME)
 
             // It might not exist if using the external SD card
-            cover.parentFile.mkdirs()
+            cover.parentFile?.mkdirs()
             input.use {
                 cover.outputStream().use {
                     input.copyTo(it)