Skip to content

Commit 0c0caa1

Browse files
JusterZhuclaude
andcommitted
fix: remove ApplicationIcon from csproj (Android library), fix nullable warning in PhysicalFileStorage
- ApplicationIcon is for Windows desktop executables, not Android libraries (it caused CI build failure: 'Could not find file GeneralUpdate.ico') - PhysicalFileStorage.ReadAllTextAsync: rewrite ternary to async/await to resolve CS8619 nullable inference ambiguity Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8f42e04 commit 0c0caa1

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/GeneralUpdate.Avalonia.Android/GeneralUpdate.Avalonia.Android.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net10.0-android</TargetFramework>
4-
<ApplicationIcon>GeneralUpdate.ico</ApplicationIcon>
54
<PackageIcon>GeneralUpdate.png</PackageIcon>
65
<SupportedOSPlatformVersion>26.0</SupportedOSPlatformVersion>
76
<Nullable>enable</Nullable>

src/GeneralUpdate.Avalonia.Android/Services/PhysicalFileStorage.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ public Stream OpenWrite(string filePath, bool append)
3535
return new FileStream(filePath, mode, FileAccess.Write, FileShare.None);
3636
}
3737

38-
public Task<string?> ReadAllTextAsync(string filePath, CancellationToken cancellationToken = default)
38+
public async Task<string?> ReadAllTextAsync(string filePath, CancellationToken cancellationToken = default)
3939
{
40-
return File.Exists(filePath)
41-
? File.ReadAllTextAsync(filePath, cancellationToken)
42-
: Task.FromResult<string?>(null);
40+
if (!File.Exists(filePath))
41+
return null;
42+
return await File.ReadAllTextAsync(filePath, cancellationToken).ConfigureAwait(false);
4343
}
4444

4545
public Task WriteAllTextAsync(string filePath, string content, CancellationToken cancellationToken = default)

0 commit comments

Comments
 (0)