IR: Properly return nullptr when getAggregateElement is out-of-bounds