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

This commit is contained in:
Michael Natterer
2015-05-30 22:19:36 +02:00
parent 04688e9c93
commit 2e07e938f4
2 changed files with 9 additions and 4 deletions

View File

@ -1145,7 +1145,8 @@ gimp_display_shell_get_color_profile (GimpColorManaged *managed)
if (image) if (image)
return gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (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 static void

View File

@ -21,11 +21,13 @@
#include "config.h" #include "config.h"
#include <glib-object.h> #include <gio/gio.h>
#include <gegl.h>
#include "gimpcolortypes.h" #include "gimpcolortypes.h"
#include "gimpcolormanaged.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: * gimp_color_managed_get_color_profile:
* @managed: an object the implements the #GimpColorManaged interface * @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. * Return value: The @managed's #GimpColorProfile.
* *
@ -150,7 +153,8 @@ gimp_color_managed_get_color_profile (GimpColorManaged *managed)
if (iface->get_color_profile) if (iface->get_color_profile)
return iface->get_color_profile (managed); return iface->get_color_profile (managed);
return NULL; /* never return a NULL profile */
return gimp_lcms_create_srgb_profile ();
} }
/** /**