Skip to content

Commit 09b34f1

Browse files
committed
Fixed Server Blazor app Null reference.
1 parent c90bad7 commit 09b34f1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Majorsoft.Blazor.Components.PermaLink/PermaLinkBlazorServerInitializer.razor

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@
3939
[Parameter] public bool SmoothScroll
4040
{
4141
get => _permalinkWatcher.SmoothScroll;
42-
set { _permalinkWatcher.SmoothScroll = value; }
42+
set
43+
{
44+
if(_permalinkWatcher is not null)
45+
{
46+
_permalinkWatcher.SmoothScroll = value;
47+
}
48+
}
4349
}
4450

4551
public async ValueTask DisposeAsync()

0 commit comments

Comments
 (0)