Save after deleting a config. Reset target to no-op when deleting its config, rather...
[enjoyable.git] / Config.m
index 55162b0..046ccc2 100644 (file)
--- a/Config.m
+++ b/Config.m
 
 - (NSDictionary *)serialize {
     NSMutableDictionary* cfgEntries = [[NSMutableDictionary alloc] initWithCapacity:_entries.count];
-    for (id key in _entries)
-        cfgEntries[key] = [_entries[key] serialize];
+    for (id key in _entries) {
+        id serialized = [_entries[key] serialize];
+        if (serialized)
+            cfgEntries[key] = serialized;
+    }
     return @{ @"name": _name, @"entries": cfgEntries };
 }