diff --git a/wicd/configmanager.py b/wicd/configmanager.py index b93b1a6..6782821 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -124,6 +124,9 @@ class ConfigManager(RawConfigParser): def write(self): """ Writes the loaded config file to disk. """ + for section in self.sections(): + if not section: + self.remove_section(section) configfile = open(self.config_file, 'w') RawConfigParser.write(self, configfile) configfile.close() diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 7235ba8..201b8f5 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1446,6 +1446,8 @@ class WiredDaemon(dbus.service.Object): @dbus.service.method('org.wicd.daemon.wired') def CreateWiredNetworkProfile(self, profilename, default=False): """ Creates a wired network profile. """ + if not profilename: + return False profilename = misc.to_unicode(profilename) print "Creating wired profile for " + profilename if self.config.has_section(profilename):