Forráskód Böngészése

Fix to little exception in SQLiteProvider

Kenric Nugteren 7 hónapja
szülő
commit
6d021c587a
1 módosított fájl, 5 hozzáadás és 2 törlés
  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;
     }