これでいんでね?
array.indexWhere(x => x != null && x.id == 1)