Skip to content

Commit 45cdfde

Browse files
authored
Fix: Fixed issue where previewing css files caused app to crash (#10666)
Fix text read when longer than 4096 chars
1 parent d6a673e commit 45cdfde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Files.App/Filesystem/BaseStorage/BaseStorageFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public async Task<string> ReadTextAsync(int maxLength = -1)
107107
var data = new char[charsToRead];
108108
charsRead = await dataReader.ReadAsync(data);
109109
builder.Append(data, 0, charsRead);
110-
} while (charsRead > 0 && inputStream.Position < inputStream.Size);
110+
} while (charsRead > 0 && stream.Position < stream.Length);
111111
return builder.ToString();
112112
}
113113

0 commit comments

Comments
 (0)