[gnome-characters/wip/properties: 14/14] character: Check if decomposition is non-null



commit 84882f0ff49e2bea631270469c27b0bf5ded1a25
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]