Skip to content

Commit 6760119

Browse files
committed
fix: do not append tail if it is null
Signed-off-by: leo <longshuang@msn.cn>
1 parent b6398b4 commit 6760119

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Models/DiffResult.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ public void GeneratePatchFromSelection(Change change, string fileTreeGuid, TextD
254254
}
255255
}
256256

257-
writer.WriteLine($" {tail}");
257+
if (!string.IsNullOrEmpty(tail))
258+
writer.WriteLine($" {tail}");
258259
writer.Flush();
259260
}
260261

@@ -405,7 +406,8 @@ public void GeneratePatchFromSelectionSingleSide(Change change, string fileTreeG
405406
}
406407
}
407408

408-
writer.WriteLine($" {tail}");
409+
if (!string.IsNullOrEmpty(tail))
410+
writer.WriteLine($" {tail}");
409411
writer.Flush();
410412
}
411413

0 commit comments

Comments
 (0)