From 55fd389a70b357fa46fd7fcba6f74d8830dd2051 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 18 Feb 2015 13:17:41 +0100 Subject: New filebrowser bookmarks: Some minor fix/optimization from latest coverity report. --- source/blender/editors/space_file/file_ops.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 9e7adaa2de5..f8d13bb6adb 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -646,6 +646,10 @@ static int bookmark_move_exec(bContext *C, wmOperator *op) const int act_index = sfile->bookmarknr; int new_index; + if (totitems < 2) { + return OPERATOR_CANCELLED; + } + switch (direction) { case FILE_BOOKMARK_MOVE_TOP: new_index = 0; -- cgit v1.2.3