New filebrowser bookmarks: Some minor fix/optimization from latest coverity report.

This commit is contained in:
Bastien Montagne 2015-02-18 13:17:41 +01:00
parent 2967253ae4
commit 55fd389a70

@ -646,6 +646,10 @@ static int bookmark_move_exec(bContext *C, wmOperator *op)
const int act_index = sfile->bookmarknr; const int act_index = sfile->bookmarknr;
int new_index; int new_index;
if (totitems < 2) {
return OPERATOR_CANCELLED;
}
switch (direction) { switch (direction) {
case FILE_BOOKMARK_MOVE_TOP: case FILE_BOOKMARK_MOVE_TOP:
new_index = 0; new_index = 0;