diff --git a/packages/skia/src/skia/types/RRect.ts b/packages/skia/src/skia/types/RRect.ts index 16f7ba7d20..486e173306 100644 --- a/packages/skia/src/skia/types/RRect.ts +++ b/packages/skia/src/skia/types/RRect.ts @@ -18,6 +18,12 @@ export interface NonUniformRRect { export type InputRRect = SkRRect | NonUniformRRect; // We have an issue to check property existence on JSI backed instances -export const isRRect = (def: SkRect | SkRRect): def is SkRRect => - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (def as any).rect !== undefined; +export const isRRect = (def: unknown): def is SkRRect => { + "worklet"; + return ( + typeof def === "object" && + def !== null && + // eslint-disable-next-line @typescript-eslint/no-explicit-any + typeof (def as any).rect === "object" + ); +};