Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/core/renderers/webgl/internal/RendererUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ export function createIndexBuffer(glw: WebGlContextWrapper, size: number) {
export function isHTMLImageElement(obj: unknown): obj is HTMLImageElement {
return (
obj !== null &&
typeof obj === 'object' &&
obj.constructor &&
obj.constructor.name === 'HTMLImageElement'
((typeof obj === 'object' &&
obj.constructor &&
obj.constructor.name === 'HTMLImageElement') ||
obj instanceof HTMLImageElement)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be safe/better to do the instanceof check first?

);
}

Expand Down
Loading