Skip to content

Commit

Permalink
fix(image.ts): make accessing classList of HtmlImage optional in setE…
Browse files Browse the repository at this point in the history
…lement function to prevent error when using node canvas image
  • Loading branch information
SvenFackert authored Jan 23, 2025
1 parent de788a7 commit b507790
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shapes/Image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class FabricImage<
this._element = element;
this._originalElement = element;
this._setWidthHeight(size);
element.classList.add(FabricImage.CSS_CANVAS);
element.classList?.add(FabricImage.CSS_CANVAS);
if (this.filters.length !== 0) {
this.applyFilters();
}
Expand Down

0 comments on commit b507790

Please sign in to comment.