Tracker: Fix crash when destWindow is NULL, fixes #20072.

Regression from hrev59676. Unfortunately pose positions are
offset by position in source window in this case, like in #19698.

Change-Id: I5278f7f473fa52f35df9019a4cb93b4f7aab53ef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10925
Reviewed-by: John Scipione <[email protected]>
This commit is contained in:
John Scipione
2026-05-05 03:46:43 +00:00
parent 4d2a3f8800
commit 7f2e069f93
+10 -1
View File
@@ -5201,8 +5201,17 @@ BPoseView::MoveSelectionInto(Model* destFolder, BContainerWindow* srcWindow,
if (okToMove) {
PoseList* selectionList = srcWindow->PoseView()->SelectionList();
BList* pointList = destWindow->PoseView()->GetDropPointList(dragStart, dropPoint,
BList* pointList = NULL;
if (destWindow != NULL) {
// destination window is available e.g. drag and drop
pointList = destWindow->PoseView()->GetDropPointList(dragStart, dropPoint,
selectionList, srcWindow->PoseView(), pinToGrid);
} else {
// destination window is closed e.g. Move to/Copy to/Link to
// pose positions will be offset by their position in the source window
pointList = srcWindow->PoseView()->GetDropPointList(dragStart, dropPoint,
selectionList, srcWindow->PoseView(), pinToGrid);
}
int32 selectionSize = srcWindow->PoseView()->CountSelected();
BObjectList<entry_ref, true>* srcList = new BObjectList<entry_ref, true>(selectionSize);