Skip to content

Commit 85171ca

Browse files
authored
fix(PdfViewer): do not render when url is empty (#508)
* fix: 兼容 null 值问题 * chore: bump version 9.0.6
1 parent 2b9a285 commit 85171ca

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/components/BootstrapBlazor.PdfViewer/BootstrapBlazor.PdfViewer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.0.5</Version>
4+
<Version>9.0.6</Version>
55
</PropertyGroup>
66

77
<PropertyGroup>

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)