Make sure there's a context and selectionMgr objects before using them

This commit is contained in:
Hadi Nategh 2018-07-25 14:11:45 +02:00
parent f99672a742
commit f5422526ce

View File

@ -104,7 +104,8 @@ 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) ?
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++)