diff --git a/src/Shipment.php b/src/Shipment.php index b1f3cd9..0e684d4 100644 --- a/src/Shipment.php +++ b/src/Shipment.php @@ -2978,6 +2978,10 @@ public function save() { } } + if ( ! $this->get_id() ) { + throw new \Exception( 'Error while saving shipment.' ); + } + $this->save_items(); if ( $cache = Helper::get_cache_object( 'shipments' ) ) {