[gnome-characters/wip/properties: 14/15] character: Check if decomposition is non-null
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters/wip/properties: 14/15] character: Check if decomposition is non-null
- Date: Tue, 10 Feb 2015 13:53:14 +0000 (UTC)
commit ac7f2345f0416e564e9ece8073800d5916848f01
Author: Daiki Ueno <dueno src gnome org>
Date: Tue Feb 10 18:32:05 2015 +0900
character: Check if decomposition is non-null
src/character.js | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/character.js b/src/character.js
index a973913..6f1e334 100644
--- a/src/character.js
+++ b/src/character.js
@@ -177,8 +177,11 @@ const CharacterDialog = new Lang.Class({
ellipsize: Pango.EllipsizeMode.END });
label.label = decomposition.map(function(d) {
let hex = Util.hexCodepoint(d);
+ // Characters in CJK Compatibility Ideographs may not
+ // have a name.
+ let name = Gc.character_name(d);
return _("<a href=\"character://%s\">%s</a>").format(
- hex, Util.capitalize(Gc.character_name(d)));
+ hex, name ? Util.capitalize(name) : _("Unknown"));
}).join('\n');
label.connect('activate-link', Lang.bind(this, this._activateLink));
this._detail_grid.attach_next_to(label,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]