From 652bddc07a33e31c187b5f094b89e3ff958f6843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 26 Feb 2023 07:42:36 +0800 Subject: [PATCH] Fixed an error in the onDragOver function in drag-and-drop-reorder.js that sometimes the dragged object may be null. --- src/accounting/static/js/drag-and-drop-reorder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/accounting/static/js/drag-and-drop-reorder.js b/src/accounting/static/js/drag-and-drop-reorder.js index 10f5106..e2b17c1 100644 --- a/src/accounting/static/js/drag-and-drop-reorder.js +++ b/src/accounting/static/js/drag-and-drop-reorder.js @@ -91,7 +91,7 @@ function initializeTouchDragAndDropReordering(list, onReorder) { * @param target {Element} the other item that was dragged over */ function onDragOver(dragged, target) { - if (target.parentElement !== dragged.parentElement || target === dragged) { + if (dragged === null || target.parentElement !== dragged.parentElement || target === dragged) { return; } let isBefore = false;