Fix #1623 Can not display empty admin fields list

This commit is contained in:
Nicolas Le Goff
2013-12-16 14:10:03 +01:00
parent 816a53a54e
commit 060d6d9fdb
3 changed files with 20 additions and 5 deletions

View File

@@ -28,7 +28,7 @@ define([
this.itemViews = [];
// force base 1 indexed
if (this.collection.first().get("sorter") === 0) {
if (this.collection.length > 0 && this.collection.first().get("sorter") === 0) {
this.collection.each(function (model) {
model.set({'sorter': model.get("sorter") + 1}, {silent: true});
});