Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): check crash on config SetScaleFactor #3967

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dom/src/dom/taitank_layout_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,9 @@ void TaitankLayoutNode::SetPosition(Edge edge, float position) {
void TaitankLayoutNode::SetScaleFactor(float sacle_factor) {
assert(engine_node_ != nullptr);
TaitankConfigRef config = engine_node_->GetConfig();
config->SetScaleFactor(sacle_factor);
if (config) {
config->SetScaleFactor(sacle_factor);
}
}

void TaitankLayoutNode::SetMaxWidth(float max_width) {
Expand Down Expand Up @@ -809,6 +811,7 @@ void TaitankLayoutNode::Allocate() { engine_node_ = new TaitankNode(); }
void TaitankLayoutNode::Deallocate() {
if (engine_node_ == nullptr) return;
delete engine_node_;
engine_node_ = nullptr;
}

std::shared_ptr<LayoutNode> CreateLayoutNode() { return std::make_shared<TaitankLayoutNode>(); }
Expand Down
Loading