Explorar el Código

[wodml] account for no code in highlight worker

cgars hace 7 años
padre
commit
b6526e43a7
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      public/js/gogs.js

+ 3 - 1
public/js/gogs.js

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