Browse Source

Merge pull request #398 from Moonlight-Panel/v2_FixNodeLogsNullRef

Fixed the null reference exception when moonlight is unable to reach the node
Masu Baumgartner 1 year ago
parent
commit
ef982a52ed
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Moonlight/Features/Servers/UI/NodeComponents/NodeLogs.razor

+ 2 - 1
Moonlight/Features/Servers/UI/NodeComponents/NodeLogs.razor

@@ -14,6 +14,7 @@
         <div class="fs-3 fw-semibold ms-3">Latest logs of <span class="text-primary">@Node.Name</span></div>
         <div class="text-end">
             <div class="input-group">
+                <span class="input-group-text">Lines</span>
                 <input @bind="LinesToFetch" type="number" class="form-control" placeholder="Lines to fetch"/>
                 <WButton OnClick="Refresh" CssClasses="btn btn-primary">
                     <i class="bx bx-sm bx-refresh"></i> Refresh
@@ -37,7 +38,7 @@
 {
     [Parameter] public ServerNode Node { get; set; }
 
-    private string[] Lines;
+    private string[] Lines = Array.Empty<string>();
     private int LinesToFetch = 25;
 
     private async Task Load(LazyLoader lazyLoader)