(coding-system-mnemonic): Don't crash if arg is nil.
authorKarl Heuer <kwzh@gnu.org>
Mon, 1 Jun 1998 03:01:30 +0000 (03:01 +0000)
committerKarl Heuer <kwzh@gnu.org>
Mon, 1 Jun 1998 03:01:30 +0000 (03:01 +0000)
lisp/international/mule.el

index 4388394..b085b90 100644 (file)
@@ -364,10 +364,10 @@ of CODING-SYSTEM.  See the function `make-coding-system' for more detail."
 
 (defun coding-system-mnemonic (coding-system)
   "Return the mnemonic character of CODING-SYSTEM.
-A mnemonic character of a coding system is used in mode line
-to indicate the coding system."
-  (or (aref (coding-system-spec coding-system) coding-spec-mnemonic-idx)
-      ?-))
+The mnemonic character of a coding system is used in mode line
+to indicate the coding system.  If the arg is nil, return ?-."
+  (let ((spec (coding-system-spec coding-system)))
+    (if spec (aref spec coding-spec-mnemonic-idx) ?-)))
 
 (defun coding-system-doc-string (coding-system)
   "Return the documentation string for CODING-SYSTEM."