(www-display-feature-desc): Fix problem when uri-object is not
authorMORIOKA Tomohiko <tomo.git@chise.org>
Thu, 20 Dec 2018 08:26:26 +0000 (16:26 +0800)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Thu, 20 Dec 2018 08:26:26 +0000 (16:26 +0800)
specified; fix problem when property `description' is not defined in
the target feature.

cwiki-view.el

index fe4586f..a24b220 100644 (file)
@@ -538,14 +538,15 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
 (defun www-display-feature-desc (uri-feature-name genre uri-object
                                                  &optional lang simple)
   (let ((rdf-uri-object (if est-hide-cgi-mode
-                           (if (string-match "=" uri-object)
-                               (concat
-                                (est-uri-decode-feature-name-body
-                                 (substring uri-object 0 (match-beginning 0)))
-                                ":"
-                                (est-uri-decode-feature-name-body
-                                 (substring uri-object (match-end 0))))
-                             uri-object)))
+                           (if (and uri-object
+                                    (string-match "=" uri-object)
+                                    (concat
+                                     (est-uri-decode-feature-name-body
+                                      (substring uri-object 0 (match-beginning 0)))
+                                     ":"
+                                     (est-uri-decode-feature-name-body
+                                      (substring uri-object (match-end 0)))))
+                               uri-object)))
        (feature-name (www-uri-decode-feature-name uri-feature-name))
        (name@lang (intern (format "name@%s" lang))))
     (princ
@@ -683,7 +684,8 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
     (www-html-display-paragraph
      (format "description : %s"
              (or (decode-coding-string
-                 (char-feature-property feature-name 'description)
+                 (or (char-feature-property feature-name 'description)
+                     "")
                  'utf-8-mcs-er)
                 "")))
     (when lang