summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-07-28 18:38:55 +0100
committerRichard Hughes <richard@hughsie.com>2014-10-10 11:47:36 +0100
commit0f30530469aebe78fa839ec9ab5dafdb293b495f (patch)
tree9f767e3a4a3049ceb4e61a685c757d80e13fd892
parenta990c5b25d02b23f3faa82f085492fbb9e53cd71 (diff)
downloadcolord-0f30530469aebe78fa839ec9ab5dafdb293b495f.tar.gz
libcolord: Do not try to return a CdIcc instance for virtual profiles
-rw-r--r--lib/colord/cd-profile.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/colord/cd-profile.c b/lib/colord/cd-profile.c
index 013cd50..bc0e0c8 100644
--- a/lib/colord/cd-profile.c
+++ b/lib/colord/cd-profile.c
@@ -1174,6 +1174,16 @@ cd_profile_load_icc (CdProfile *profile,
g_return_val_if_fail (CD_IS_PROFILE (profile), NULL);
+ /* not a local profile */
+ if (profile->priv->filename == NULL) {
+ g_set_error (error,
+ CD_PROFILE_ERROR,
+ CD_PROFILE_ERROR_INTERNAL,
+ "%s has no local instance",
+ profile->priv->id);
+ return NULL;
+ }
+
/* load local instance */
icc_tmp = cd_icc_new ();
file = g_file_new_for_path (profile->priv->filename);