mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-01 06:22:39 +08:00
Fix NullPointerException in ReactShadowNode.toString()
Summary: Fix `NullPointerException` in `ReactShadowNode.toString` Simplified `ReactShadowNode.hasNewLayout` since I was already in there It seems to me unlikely that this bug impacts anything but the debugging experience, so no biggie. Closes https://github.com/facebook/react-native/pull/12953 Differential Revision: D4739215 fbshipit-source-id: 94955cc783216fdb8868fc8d08010e0d8a238052
This commit is contained in:
committed by
Facebook Github Bot
parent
08c404d293
commit
242a58ffe0
@@ -372,7 +372,7 @@ public class ReactShadowNode {
|
||||
}
|
||||
|
||||
public final boolean hasNewLayout() {
|
||||
return mYogaNode == null ? false : mYogaNode.hasNewLayout();
|
||||
return mYogaNode != null && mYogaNode.hasNewLayout();
|
||||
}
|
||||
|
||||
public final void markLayoutSeen() {
|
||||
@@ -770,7 +770,11 @@ public class ReactShadowNode {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return mYogaNode.toString();
|
||||
if (mYogaNode != null) {
|
||||
return mYogaNode.toString();
|
||||
}
|
||||
|
||||
return getClass().getSimpleName() + " (virtual node)";
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
|
||||
Reference in New Issue
Block a user