Skip to content

Commit

Permalink
style might be undefined at this point (#4155)
Browse files Browse the repository at this point in the history
style might be undefined at this point and `Object.keys(style)` would
throw an exception

## Summary
I use a third party library and after upgrading to reanimated 3.0.0 I
get the exception at line 123.

## Test plan
I don't have a simple test case but checking that style is defined does
not hurt
  • Loading branch information
bmatasar authored Mar 3, 2023
1 parent b463d89 commit 468c53d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/createAnimatedComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ function isInlineStyleTransform(transform: any): boolean {
}

function hasInlineStyles(style: StyleProps): boolean {
if (!style) {
return false;
}
return Object.keys(style).some((key) => {
const styleValue = style[key];
return (
Expand Down

0 comments on commit 468c53d

Please sign in to comment.