Skip to content

Commit

Permalink
Fix crash when pressing 'Add' with an empty textbox
Browse files Browse the repository at this point in the history
  • Loading branch information
hovo-hakobyan committed Feb 1, 2024
1 parent 3284b3d commit 4d6f185
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SquadForger/ViewModel/SquadVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ private void ReadTeamsFromCsv()

private void AddTeams()
{
if (TeamsInput == null) return;
if (!TeamsInput.Any()) return;
// Split the input by commas and remove empty entries
List<string> teamNames = TeamsInput.Split(',').Select(s => s.Trim()).Where(s => !string.IsNullOrWhiteSpace(s)).ToList();

Expand Down

0 comments on commit 4d6f185

Please sign in to comment.