Skip to content

Commit

Permalink
Set identity instead of crash in opt build (flutter#9262)
Browse files Browse the repository at this point in the history
  • Loading branch information
liyuqian authored Jun 13, 2019
1 parent 8b44c52 commit f1d821d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flow/layers/transform_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ TransformLayer::TransformLayer(const SkMatrix& transform)
//
// We have to write this flaky test because there is no reliable way to test
// whether a variable is initialized or not in C++.
FML_CHECK(transform_.isFinite());
FML_DCHECK(transform_.isFinite());
if (!transform_.isFinite()) {
FML_LOG(ERROR) << "TransformLayer is constructed with an invalid matrix.";
transform_.setIdentity();
}
}

TransformLayer::~TransformLayer() = default;
Expand Down

0 comments on commit f1d821d

Please sign in to comment.