user-accounts: fix crash for incompatible realmd version

The version property may not be available if realmd is
version 0.1 (which lacked the property) or if other
properties changed signatures (causing gdbus to fail to load
cache any property)

This commit fixes a crash where property is NULL in those cases.
This commit is contained in:
Ray Strode 2012-08-20 13:52:49 -04:00
parent daa8b098a4
commit a416243050

View file

@ -243,10 +243,10 @@ um_realm_manager_new_finish (GAsyncResult *result,
}
version = um_realm_provider_get_version (self->provider);
if (!version_compare (version, 0, 7)) {
if (version == NULL || !version_compare (version, 0, 7)) {
/* No need to bother translators with this temporary message */
g_set_error (error, UM_REALM_ERROR, UM_REALM_ERROR_GENERIC,
"Unsupported version of realmd: %s", version);
"realmd version should be at least 0.7");
g_object_unref (self);
return NULL;
}