Skip to content

Commit 3ac6853

Browse files
committed
console null check error fix
1 parent 9dd5141 commit 3ac6853

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/code-snippet/code-snippet.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class CodeSnippet extends BaseIconButton implements OnInit, AfterViewInit
231231
let ref;
232232
switch (this.display) {
233233
case "multi":
234-
ref = this.codeContent.nativeElement;
234+
ref = this.codeContent?.nativeElement;
235235
break;
236236
case "single":
237237
ref = this.codeContainer.nativeElement;
@@ -310,7 +310,7 @@ export class CodeSnippet extends BaseIconButton implements OnInit, AfterViewInit
310310

311311
protected canExpand() {
312312
if (this.display === "multi") {
313-
const height = this.codeContent.nativeElement.getBoundingClientRect().height;
313+
const height = this.codeContent?.nativeElement.getBoundingClientRect().height;
314314
if (
315315
this.maxCollapsedNumberOfRows > 0 &&
316316
(this.maxExpandedNumberOfRows <= 0 ||

0 commit comments

Comments
 (0)