diff --git a/src/nodebuild_extract.cpp b/src/nodebuild_extract.cpp index 11332f049..bdb343449 100644 --- a/src/nodebuild_extract.cpp +++ b/src/nodebuild_extract.cpp @@ -123,7 +123,8 @@ void FNodeBuilder::Extract (node_t *&outNodes, int &nodeCount, if (segs[i].Partner != DWORD_MAX) { - outSegs[i].PartnerSeg = &outSegs[Segs[segs[i].Partner].storedseg]; + const DWORD storedseg = Segs[segs[i].Partner].storedseg; + outSegs[i].PartnerSeg = DWORD_MAX == storedseg ? nullptr : &outSegs[storedseg]; } else {