瀏覽代碼

Reverting a columns change until DatabaseSchema be fixed.

Kenric Nugteren 1 年之前
父節點
當前提交
a2062c6dd9
共有 1 個文件被更改,包括 11 次插入4 次删除
  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;