settings: fix wrong assertion in keyfiles _storages_consolidate()

The storage may also contain a tombstone, and have no connection to steal.
This commit is contained in:
Thomas Haller
2019-07-17 12:22:11 +02:00
parent f1d24f5df2
commit bc29389e8e
2 changed files with 2 additions and 2 deletions

View File

@@ -516,7 +516,6 @@ _storages_consolidate (NMSKeyfilePlugin *self,
}
connection = nms_keyfile_storage_steal_connection (storage);
nm_assert (NM_IS_CONNECTION (connection));
callback (NM_SETTINGS_PLUGIN (self),
NM_SETTINGS_STORAGE (storage),

View File

@@ -55,7 +55,8 @@ NMConnection *
nms_keyfile_storage_steal_connection (NMSKeyfileStorage *self)
{
nm_assert (NMS_IS_KEYFILE_STORAGE (self));
nm_assert (NM_IS_CONNECTION (self->connection));
nm_assert ( (!self->connection && self->is_tombstone)
|| NM_IS_CONNECTION (self->connection));
return g_steal_pointer (&self->connection);
}