Skip to content

Commit 2c6caac

Browse files
committed
fix: 兼容 null 值问题
1 parent 2b9a285 commit 2c6caac

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
8888

8989
private string GetAbsoluteUri(string? url)
9090
{
91-
url ??= string.Empty;
92-
if (string.IsNullOrEmpty(url) || !UseGoogleDocs)
91+
if (string.IsNullOrEmpty(url))
9392
{
94-
return $"{url}#page={PageIndex}";
93+
return string.Empty;
9594
}
95+
9696
var uri = NavigationManager.ToAbsoluteUri(url);
97-
return uri.AbsoluteUri;
97+
return $"{uri.AbsoluteUri}#page={PageIndex}";
9898
}
9999

100100
/// <summary>

0 commit comments

Comments
 (0)