Browse Source

Fix to little exception in SQLiteProvider

Kenric Nugteren 7 tháng trước cách đây
mục cha
commit
6d021c587a
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      inabox.database.sqlite/SQLiteProvider.cs

+ 5 - 2
inabox.database.sqlite/SQLiteProvider.cs

@@ -3294,8 +3294,11 @@ public class SQLiteProvider : IProvider
     {
         if(!_externalProperties.TryGetValue(T, out var properties))
         {
-            properties = DatabaseSchema.Properties(T).Where(x => x.HasAttribute<ExternalStorageAttribute>()).ToArray();
-            _externalProperties.Add(T, properties);
+            lock (_externalProperties)
+            {
+                properties = DatabaseSchema.Properties(T).Where(x => x.HasAttribute<ExternalStorageAttribute>()).ToArray();
+                _externalProperties.TryAdd(T, properties);
+            }
         }
         return properties;
     }