소스 검색

bugfix desktop file

milan jurkulák 2 년 전
부모
커밋
0a33387d91
1개의 변경된 파일과 1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/main/kotlin/eu/mjdev/desktop/data/DesktopFile.kt

+ 1 - 1
src/main/kotlin/eu/mjdev/desktop/data/DesktopFile.kt

@@ -11,7 +11,7 @@ import java.io.File
 @Suppress("unused", "MemberVisibilityCanBePrivate", "ConstPropertyName", "PropertyName")
 class DesktopFile(
     val file: File,
-    val content: Ini = Wini(file),
+    val content: Ini = runCatching { Wini(file) }.getOrNull() ?: Wini(),
 ) {
     var fileName: String = file.name
     val absolutePath: String = file.absolutePath