Skip to content

Commit 79a20f5

Browse files
ENGCOM-3910: Order shipping method bug #20381
- Merge Pull Request #20381 from maheshWebkul721/magento2:order-shipping-method-bug - Merged commits: 1. 0759026 2. 9c6af93 3. bf246da 4. 45c6fc7 5. 82b1707 6. ccd3014
2 parents e5c1527 + ccd3014 commit 79a20f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/Sales/Model/Order.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,12 +1279,12 @@ public function getTrackingNumbers()
12791279
* Retrieve shipping method
12801280
*
12811281
* @param bool $asObject return carrier code and shipping method data as object
1282-
* @return string|\Magento\Framework\DataObject
1282+
* @return string|null|\Magento\Framework\DataObject
12831283
*/
12841284
public function getShippingMethod($asObject = false)
12851285
{
12861286
$shippingMethod = parent::getShippingMethod();
1287-
if (!$asObject) {
1287+
if (!$asObject || !$shippingMethod) {
12881288
return $shippingMethod;
12891289
} else {
12901290
list($carrierCode, $method) = explode('_', $shippingMethod, 2);

0 commit comments

Comments
 (0)