↑ | 1-814
-- | --
815 | YGNodeRef yogaOldParent = GetYogaNode(oldParentTag);
816 | if (yogaOldParent != nullptr) {
817 | YGNodeRemoveChild(yogaOldParent, yogaNodeToAdd);
| In AddView result of call to GetYogaNode is dereferenced here and may be null.
818 | }
819 |
820 | YGNodeInsertChild(yogaNodeToManage, yogaNodeToAdd, static_cast(index));
| In AddView result of call to GetYogaNode is dereferenced here and may be null.In AddView result of call to GetYogaNode is dereferenced here and may be null.
821 | }
822 | }
↓↑ | 823-832
833 | for (uint32_t i = childCount; i > 0; --i) {
834 | YGNodeRef yogaNodeToRemove = YGNodeGetChild(yogaNode, i - 1);
835 | YGNodeRemoveChild(yogaNode, yogaNodeToRemove);
| In RemoveView result of call to YGNodeGetChild is dereferenced here and may be null.
836 | }
837 | }
↓↑ | 838-871
872 | if (pViewManager->RequiresYogaNode()) {
873 | YGNodeRef yogaNode = GetYogaNode(node.m_tag);
874 | StyleYogaNode(node, yogaNode, props);
| In UpdateView result of call to GetYogaNode is dereferenced here and may be null.
875 | }
876 | }
↓ | 877-1162
Problem Description
CodeQL reports 5
Result of call that may return NULL dereferenced unconditionally
errors in the NativeUIManager.cpp file.Steps To Reproduce
Link to the CodeQL (corpnet-only): https://onees.lgtm.microsoft.com/projects/u/gh/microsoft%2Freact-native-windows%2Ftree%2Fmain/alerts/?mode=tree&ruleFocus=1000894
Expected Results
No response
CLI version
npx react-native --version
Environment
Target Platform Version
No response
Target Device(s)
No response
Visual Studio Version
No response
Build Configuration
No response
Snack, code example, screenshot, or link to a repository