word/edit: ignore missing binomial name in wp download
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 31 Dec 2021 04:02:19 +0000 (05:02 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 31 Dec 2021 04:29:05 +0000 (05:29 +0100)
word/editor.js

index da403b2217ad31c75178ea6cb1cc958cf7f2d1f1..cee26ac1e9a4aafe01f06f0679719d2f4f62b452 100644 (file)
@@ -31,7 +31,9 @@ document.addEventListener('DOMContentLoaded', () => {
                                let transrow = document.getElementById('trans-la');
                                if (transrow && !transrow.value && wptext) {
                                        const binom = wptext.match(/ class="binomial">.*?<i>(.*?)<\/i>/);
-                                       transrow.value = binom[1]
+                                       if (binom) {
+                                               transrow.value = binom[1]
+                                       }
                                }
 
                                // translations from language links