Sfoglia il codice sorgente

[wodml] account for no code in highlight worker

cgars 7 anni fa
parent
commit
b6526e43a7
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      public/js/gogs.js

+ 3 - 1
public/js/gogs.js

@@ -1281,7 +1281,9 @@ $(document).ready(function () {
                 worker.onmessage = function (event) {
                     code.innerHTML = event.data;
                 }
-                worker.postMessage(code.textContent);
+                if (code !== null) {
+                    worker.postMessage(code.textContent);
+                }
             })
         } else {
             hljs.initHighlightingOnLoad()