CDB-2677 #resolve - after an error deleting a layer, js exception fixed
Merge CDB-2677 into release/2.13.1