Skip to content

Commit

Permalink
Added missing null checks (#4159)
Browse files Browse the repository at this point in the history
## Summary

Added missing null checks in release of Reanimated 3.0.0

Fixes #4153
  • Loading branch information
piaskowyk authored Mar 3, 2023
1 parent d249b38 commit e2a5454
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/createAnimatedComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ const has = <K extends string>(
};

function isInlineStyleTransform(transform: any): boolean {
if (!transform) {
return false;
}
return transform.some((t: Record<string, any>) => hasInlineStyles(t));
}

Expand All @@ -142,6 +145,9 @@ function extractSharedValuesMapFromProps(
if (key === 'style') {
const styles = flattenArray<StyleProps>(props.style ?? []);
styles.forEach((style) => {
if (!style) {
return;
}
for (const [key, styleValue] of Object.entries(style)) {
if (isSharedValue(styleValue)) {
inlineProps[key] = styleValue;
Expand Down
3 changes: 3 additions & 0 deletions src/reanimated2/layoutReanimation/animationsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ function createLayoutAnimationManager() {
},
stop(tag: number) {
const value = mutableValuesForTag.get(tag);
if (!value) {
return;
}
stopObservingProgress(tag, value, true, true);
},
};
Expand Down

0 comments on commit e2a5454

Please sign in to comment.