Skip to content

Commit

Permalink
Merge pull request #1254 from Shopify/fix/1253-fix-missing-error-font…
Browse files Browse the repository at this point in the history
…-prop

#1253: Fixed missing error message if null guard is missing for font prop.
  • Loading branch information
chrfalch authored Jan 6, 2023
2 parents 36c3748 + 3e2fc05 commit f666adf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package/cpp/rnskia/dom/props/FontProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class FontProp : public DerivedProp<SkFont> {
}

void updateDerivedValue() override {
if (_fontProp->value().getType() != PropType::HostObject) {
if (!_fontProp->isSet() ||
_fontProp->value().getType() != PropType::HostObject) {
throw std::runtime_error("Expected SkFont object for the Font property.");
}

Expand Down

0 comments on commit f666adf

Please sign in to comment.