From 77799b0e9604fdbce703f586f891fd1da08a659f Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Mon, 28 Jun 2021 23:10:35 +0200 Subject: [PATCH] Fix crash on unknown character This commit allows any unknown characters to be passed in text fed to `conlanging-proto-nyqy-to-phonetics' without any crash. Unrecognized characters will just be ignored. --- conlanging.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/conlanging.el b/conlanging.el index bddacf9..d561025 100644 --- a/conlanging.el +++ b/conlanging.el @@ -340,16 +340,17 @@ See `conlanging--proto-nyqy-phoneme'.") (equal (oref elem :grapheme) grapheme)) conlanging--proto-nyqy-phonetics))) - (if (oref cur-phoneme :is-consonant) - (progn - (when (eq dorsal 'undefined) - (setq dorsal (oref cur-phoneme :is-dorsal))) - (setq phonetics (concat phonetics - (if dorsal - (oref cur-phoneme :phoneme) - (oref cur-phoneme :alt-phoneme)))) - (setq dorsal (not dorsal))) - (setq phonetics (concat phonetics (oref cur-phoneme :phoneme)))))) + (when cur-phoneme + (if (oref cur-phoneme :is-consonant) + (progn + (when (eq dorsal 'undefined) + (setq dorsal (oref cur-phoneme :is-dorsal))) + (setq phonetics (concat phonetics + (if dorsal + (oref cur-phoneme :phoneme) + (oref cur-phoneme :alt-phoneme)))) + (setq dorsal (not dorsal))) + (setq phonetics (concat phonetics (oref cur-phoneme :phoneme))))))) phonetics)) ;;;###autoload