From 3700b3df55f20e7b4fd4bbea77e8b6d4d34b5a6b Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 25 Jul 2018 14:11:45 +0200 Subject: [PATCH] Make sure there's a context and selectionMgr objects before using them --- api/js/egw_action/egw_action_dragdrop.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/js/egw_action/egw_action_dragdrop.js b/api/js/egw_action/egw_action_dragdrop.js index 7b45a582da..3c930e552e 100644 --- a/api/js/egw_action/egw_action_dragdrop.js +++ b/api/js/egw_action/egw_action_dragdrop.js @@ -104,8 +104,9 @@ function egwDragActionImplementation() // Take select all into account when counting number of rows, because they may not be // in _selected object - var pseudoNumRows = (_selected[0] && _selected[0]._context._selectionMgr._selectAll) ? - _selected[0]._context._selectionMgr._total : _selected.length; + var pseudoNumRows = (_selected[0] && _selected[0]._context && _selected[0]._context._selectionMgr && + _selected[0]._context._selectionMgr._selectAll) ? + _selected[0]._context._selectionMgr._total : _selected.length; for (var i = 0; i < _selected.length;i++) {