Skip to content

Commit

Permalink
Fix measureLayout function for Virtual Nodes
Browse files Browse the repository at this point in the history
Summary:
This diff fixes a NullPointerException thrown when calling measureLayout function on a virtual node.

changelog: [Android] Fix measureLayout function for VirtualTexts

Reviewed By: JoshuaGross

Differential Revision: D21435030

fbshipit-source-id: aba6d81f333464e49d2d769b111842e7ae8ce769
  • Loading branch information
mdvacca authored and facebook-github-bot committed May 6, 2020
1 parent ff0c625 commit 5c48c94
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ private void measureLayoutRelativeToVerifiedAncestor(
ReactShadowNode node, ReactShadowNode ancestor, int[] outputBuffer) {
int offsetX = 0;
int offsetY = 0;
if (node != ancestor) {
if (node != ancestor && !node.isVirtual()) {
offsetX = Math.round(node.getLayoutX());
offsetY = Math.round(node.getLayoutY());
ReactShadowNode current = node.getParent();
Expand Down

0 comments on commit 5c48c94

Please sign in to comment.