fix updateIndex when value is null in emitBlock