diff options
-rw-r--r-- | endless/eosattribution.c | 2 | ||||
-rw-r--r-- | endless/eoslicense.c | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/endless/eosattribution.c b/endless/eosattribution.c index c930169..87d0876 100644 --- a/endless/eosattribution.c +++ b/endless/eosattribution.c @@ -226,7 +226,7 @@ render_license_link (GtkTreeViewColumn *column, string. Note: this string is markup, and so should not contain any ampersands (&), less-than signs (<), or greater-than signs (>). */ gchar *license_string = g_strdup_printf (_("%s."), - gettext (eos_get_license_display_name (license_code))); + eos_get_license_display_name (license_code)); gboolean behave_like_link = (license_uri != NULL); g_object_set (renderer, "markup", license_string, diff --git a/endless/eoslicense.c b/endless/eoslicense.c index d080942..5d7301f 100644 --- a/endless/eoslicense.c +++ b/endless/eoslicense.c @@ -173,10 +173,11 @@ eos_get_license_display_name (const gchar *license) g_free (sanitized_license); /* If the array value is null, it means we don't have a license file for that - license name. */ - g_return_val_if_fail (recognized_licenses[index] != NULL, NULL); + license name. */ + if (recognized_licenses[index] == NULL) + return _("Unknown license"); - return recognized_licenses_display_names[index]; + return gettext (recognized_licenses_display_names[index]); } /** @@ -185,9 +186,11 @@ eos_get_license_display_name (const gchar *license) * * Retrieves a GFile for the specified licene and the current locale. * - * Returns: (transfer full): A GFile for the specified @license name and the - * current locale. It returns NULL if the license - * is not found or does not have an associated file. + * Returns: (transfer full) (allow-none): A GFile for the specified @license + * name and the current locale. It + * returns %NULL if the license is not + * found or does not have an associated + * file. * Since: 0.4 */ GFile * @@ -199,9 +202,6 @@ eos_get_license_file (const gchar *license) int index = get_license_index (sanitized_license); g_free (sanitized_license); - /* If the code array value is null, it means it is an unrecognized license code. */ - g_return_val_if_fail (recognized_licenses[index] != NULL, NULL); - /* If the array value is null, it means we don't have a license file for that license name. */ if (recognized_licenses_filenames[index] == NULL) |