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



commit 0b7ad2ada958816753da36d11758e5dd5b5c739a
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]