diff --git a/html_resources/code-block/code-block.js b/html_resources/code-block/code-block.js
index 73c3095..3cf0f74 100644
--- a/html_resources/code-block/code-block.js
+++ b/html_resources/code-block/code-block.js
@@ -21,7 +21,11 @@ class CodeBlock extends HTMLElement{
}
determineAndLoadContent(){
- CodeBlock.getSource(this.src)
+ const src = this.src;
+ if(!src){
+ return
+ }
+ CodeBlock.getSource(src)
.then(
(data) => this.consumeData(data,CodeBlock.InsertMode.Replace),
(e) => this.consumeData({content:this.textContent},CodeBlock.InsertMode.Replace)
@@ -313,7 +317,10 @@ class CodeBlock extends HTMLElement{
}
get codeBox(){
- return this.shadowRoot.querySelector("tbody");
+ if(!this._codeBox){
+ this._codeBox = this.shadowRoot.querySelector("tbody");
+ }
+ return this._codeBox;
}
get value(){
return this.codeBox.textContent