Commit 2e07e938 authored by Michael Natterer's avatar Michael Natterer 😴

app, libgimpcolor: never return NULL in GimpColorManaged::get_color_profile()

parent 04688e9c
......@@ -1145,7 +1145,8 @@ gimp_display_shell_get_color_profile (GimpColorManaged *managed)
if (image)
return gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (image));
return NULL;
/* never return a NULL profile */
return gimp_lcms_create_srgb_profile ();;
}
static void
......
......@@ -21,11 +21,13 @@
#include "config.h"
#include <glib-object.h>
#include <gio/gio.h>
#include <gegl.h>
#include "gimpcolortypes.h"
#include "gimpcolormanaged.h"
#include "gimplcms.h"
/**
......@@ -132,7 +134,8 @@ gimp_color_managed_get_icc_profile (GimpColorManaged *managed,
* gimp_color_managed_get_color_profile:
* @managed: an object the implements the #GimpColorManaged interface
*
* This function, if implemented, always returns a #GimpColorProfile.
* This function always returns a #GimpColorProfile and falls back to
* gimp_lcms_create_srgb_profile() if the method is not implemented.
*
* Return value: The @managed's #GimpColorProfile.
*
......@@ -150,7 +153,8 @@ gimp_color_managed_get_color_profile (GimpColorManaged *managed)
if (iface->get_color_profile)
return iface->get_color_profile (managed);
return NULL;
/* never return a NULL profile */
return gimp_lcms_create_srgb_profile ();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment