diff --git a/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml index d773ff41..9eb1f5ec 100644 --- a/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml @@ -57,9 +57,7 @@ } else { - authorLabels = Model.Slot?.AuthorLabels.Split(",") ?? Array.Empty(); - // Split() returns an array with an empty character for some reason - if (authorLabels.Length == 1) authorLabels = Array.Empty(); + authorLabels = Model.Slot?.AuthorLabels.Split(",", StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty(); } if (authorLabels.Length == 0) { diff --git a/ProjectLighthouse/Logging/Loggers/ConsoleLogger.cs b/ProjectLighthouse/Logging/Loggers/ConsoleLogger.cs index 92693d05..48cc7131 100644 --- a/ProjectLighthouse/Logging/Loggers/ConsoleLogger.cs +++ b/ProjectLighthouse/Logging/Loggers/ConsoleLogger.cs @@ -10,7 +10,7 @@ public class ConsoleLogger : ILogger ConsoleColor oldForegroundColor = Console.ForegroundColor; ConsoleColor logColor = logLine.Level.ToColor(); - foreach (string line in logLine.Message.Split('\n')) + foreach (string line in logLine.Message.Split('\n', StringSplitOptions.RemoveEmptyEntries)) { string time = DateTime.Now.ToString("MM/dd/yyyy-HH:mm:ss.fff"); string trace = ""; diff --git a/ProjectLighthouse/PlayerData/Reviews/Review.cs b/ProjectLighthouse/PlayerData/Reviews/Review.cs index 32690ebb..b5c33914 100644 --- a/ProjectLighthouse/PlayerData/Reviews/Review.cs +++ b/ProjectLighthouse/PlayerData/Reviews/Review.cs @@ -1,4 +1,5 @@ #nullable enable +using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Xml.Serialization; @@ -38,7 +39,7 @@ public class Review [NotMapped] [XmlIgnore] public string[] Labels { - get => this.LabelCollection.Split(","); + get => this.LabelCollection.Split(",", StringSplitOptions.RemoveEmptyEntries); set => this.LabelCollection = string.Join(',', value); }