Fixed NPE when trying to add a delivery between the last delivery and the warehouse.