service: Simplify nameserver route adding and removing
[framework/connectivity/connman.git] / plugins / pptp.c
index 37e8459..9db1b89 100644 (file)
@@ -3,7 +3,7 @@
  *  Connection Manager
  *
  *  Copyright (C) 2010  BMW Car IT GmbH. All rights reserved.
- *  Copyright (C) 2011  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2012  Intel Corporation. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
@@ -210,6 +210,9 @@ static int pptp_save(struct connman_provider *provider, GKeyFile *keyfile)
                if (strncmp(pptp_options[i].cm_opt, "PPTP.", 5) == 0) {
                        option = connman_provider_get_string(provider,
                                                        pptp_options[i].cm_opt);
+                       if (option == NULL)
+                               continue;
+
                        g_key_file_set_string(keyfile,
                                        connman_provider_get_save_group(provider),
                                        pptp_options[i].cm_opt, option);