Shopify / Shopify/react-native-skia

Crash when painting empty color on a svg

Open
#2,683 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
8.6k
Forks
647
Avg merge
1d 17h
Merged PRs (30d)
35

Description

Description

I found a crash due to a 'bad' usage of the API.
when painting a svg with an undefined color.value

<BlendColor color={color} mode="srcIn" />

The app crash with error:
Missing one or more required properties color in the skBlendColorFilter component.

Version

1.3.13

Steps to reproduce

Following sample

        <Group
          transform={transform}
          layer={
            <Paint>
              <BlendColor color={color} mode="srcIn" />
            </Paint>
          }
        >
          <ImageSVG svg={svg} />
        </Group>
Snack, code example, screenshot, or link to a repository

I can do it if you want, but as it is a bad usage, I am not sure it will be investigated.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named; start from the BlendColor component/API shown in the reproduction and run the supplied JSX case with an undefined color.value. Trace the missing-color error path and determine the intended handling for this invalid input. Done means the case no longer crashes unexpectedly or has clearly defined error behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
computer-graphics, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.