::getIndex() should never return -1 if ::file() is not null so no check needed there..