diff --git a/base/src/main/kotlin/de/staropensource/engine/base/implementation/stream/FileAccessStream.kt b/base/src/main/kotlin/de/staropensource/engine/base/implementation/stream/FileAccessStream.kt index d52f451..e46451c 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/implementation/stream/FileAccessStream.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/implementation/stream/FileAccessStream.kt @@ -102,7 +102,12 @@ class FileAccessStream internal constructor(val file: FileAccess) : Stream(strea .createFile() .verifyIsFile() - return inputStream.read().toByte() + val byte: Int = inputStream.read() + + return if (byte == -1) + null + else + byte.toByte() } catch (_: VerificationFailedException) { throw IOAccessException("File '${file}' does not exist") }