diff --git a/data/class/helper/SC_Helper_Purchase.php b/data/class/helper/SC_Helper_Purchase.php index 8f2d1be7c9..a14db3f51c 100644 --- a/data/class/helper/SC_Helper_Purchase.php +++ b/data/class/helper/SC_Helper_Purchase.php @@ -260,7 +260,8 @@ public static function getOrderTemp($uniqId) { $objQuery = SC_Query_Ex::getSingletonInstance(); - return $objQuery->getRow('*', 'dtb_order_temp', 'order_temp_id = ?', [$uniqId]); + $result = $objQuery->getRow('*', 'dtb_order_temp', 'order_temp_id = ?', [$uniqId]); + return is_array($result) ? $result : []; // 必ず配列を返す } /** diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTempTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTempTest.php index ba100a8433..6b27c53afb 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTempTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderTempTest.php @@ -58,7 +58,7 @@ public function testGetOrderTemp存在しない受注IDを指定した場合結 { $order_id = '9999'; - $this->expected = null; + $this->expected = []; $this->actual = SC_Helper_Purchase::getOrderTemp($order_id); $this->verify();