Browse Source

Reverting a columns change until DatabaseSchema be fixed.

Kenric Nugteren 1 year ago
parent
commit
a2062c6dd9
1 changed files with 11 additions and 4 deletions
  1. 11 4
      InABox.Core/Column.cs

+ 11 - 4
InABox.Core/Column.cs

@@ -389,14 +389,21 @@ namespace InABox.Core
         {
             if (!Contains(column))
             {
-                var property = DatabaseSchema.Property(typeof(T), column);
-                if(property is null)
+                if(CoreUtils.TryGetProperty(typeof(T), column, out var propertyInfo))
                 {
-                    Logger.Send(LogType.Error, "", $"Property {column} does not exist on {typeof(T).Name}");
+                    columns.Add(new Column<T>(column));
                 }
                 else
                 {
-                    columns.Add(new Column<T>(property));
+                    var property = DatabaseSchema.Property(typeof(T), column);
+                    if(property is null)
+                    {
+                        Logger.Send(LogType.Error, "", $"Property {column} does not exist on {typeof(T).Name}");
+                    }
+                    else
+                    {
+                        columns.Add(new Column<T>(property));
+                    }
                 }
             }
             return this;