mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
gkeyfilesettingsbackend: do not assume filename is non-NULL
Fixes #1825
This commit is contained in:
@@ -734,13 +734,16 @@ g_keyfile_settings_backend_set_property (GObject *object,
|
|||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object);
|
GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object);
|
||||||
|
const gchar *filename;
|
||||||
|
|
||||||
switch ((GKeyfileSettingsBackendProperty)prop_id)
|
switch ((GKeyfileSettingsBackendProperty)prop_id)
|
||||||
{
|
{
|
||||||
case PROP_FILENAME:
|
case PROP_FILENAME:
|
||||||
/* Construct only. */
|
/* Construct only. */
|
||||||
g_assert (kfsb->file == NULL);
|
g_assert (kfsb->file == NULL);
|
||||||
kfsb->file = g_file_new_for_path (g_value_get_string (value));
|
filename = g_value_get_string (value);
|
||||||
|
if (filename)
|
||||||
|
kfsb->file = g_file_new_for_path (filename);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ROOT_PATH:
|
case PROP_ROOT_PATH:
|
||||||
|
Reference in New Issue
Block a user