Просмотр исходного кода

Added handling for nil Realm property values

Tim Oliver лет назад: 10
Родитель
Сommit
552e687b9c
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDatabaseManager.m

+ 2 - 1
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXRealmDatabaseManager.m

@@ -101,7 +101,8 @@
     for (RLMObject *result in results) {
     for (RLMObject *result in results) {
         NSMutableDictionary *entry = [NSMutableDictionary dictionary];
         NSMutableDictionary *entry = [NSMutableDictionary dictionary];
         for (RLMProperty *property in objectSchema.properties) {
         for (RLMProperty *property in objectSchema.properties) {
-            entry[property.name] = [result valueForKey:property.name];
+            id value = [result valueForKey:property.name];
+            entry[property.name] = (value) ? (value) : [NSNull null];
         }
         }
         
         
         [allDataEntries addObject:entry];
         [allDataEntries addObject:entry];