瀏覽代碼

possible audit log fix

Daniel Balk 2 年之前
父節點
當前提交
227ad493b7

+ 4 - 1
Moonlight/App/Services/LogServices/AuditLogService.cs

@@ -73,8 +73,11 @@ public class AuditLogService
     {
         private List<LogData> Data = new List<LogData>();
 
-        public void Add<T>(object data)
+        public void Add<T>(object? data)
         {
+            if(data == null)
+                return;
+            
             Data.Add(new LogData()
             {
                 Type = typeof(T),

+ 4 - 1
Moonlight/App/Services/LogServices/ErrorLogService.cs

@@ -98,8 +98,11 @@ public class ErrorLogService
     {
         private List<LogData> Data = new List<LogData>();
 
-        public void Add<T>(object data)
+        public void Add<T>(object? data)
         {
+            if(data == null)
+                return;
+
             Data.Add(new LogData()
             {
                 Type = typeof(T),

+ 4 - 1
Moonlight/App/Services/LogServices/SecurityLogService.cs

@@ -72,8 +72,11 @@ public class SecurityLogService
     {
         private List<LogData> Data = new List<LogData>();
 
-        public void Add<T>(object data)
+        public void Add<T>(object? data)
         {
+            if(data == null)
+                return;
+
             Data.Add(new LogData()
             {
                 Type = typeof(T),