Changed assertion of '..' in file browser entries

The previous assert assumed '..' is always there, which isn't necessarily
true (for example when in the root of an Asset Engine repository).

The new code asserts that if '..' is present it should be the first entry
(rather than forcing the first entry to be '..').
This commit is contained in:
Sybren A. Stüvel 2018-04-11 15:06:42 +02:00
parent 5a3c146652
commit 8aa6e4d50b
1 changed files with 1 additions and 1 deletions

View File

@ -597,7 +597,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
int colorid = (file_selflag & FILE_SEL_SELECTED) ? TH_HILITE : TH_BACK;
int shade = (params->highlight_file == i) || (file_selflag & FILE_SEL_HIGHLIGHTED) ? 35 : 0;
BLI_assert(i > 0 || FILENAME_IS_CURRPAR(file->relpath));
BLI_assert(i == 0 || !FILENAME_IS_CURRPAR(file->relpath));
draw_tile(sx, sy - 1, layout->tile_w + 4, sfile->layout->tile_h + layout->tile_border_y, colorid, shade);
}