Set some defaults to null in get vehicles #395

This commit is contained in:
Kendrick Chan 2020-05-01 14:29:40 +08:00
parent 976fca1261
commit 381323a07e

View file

@ -718,11 +718,11 @@ class APIController extends Controller implements LoggedController
$cvs = $cust->getVehicles();
foreach ($cvs as $cv)
{
$battery_id = '';
$battery_id = null;
if ($cv->getCurrentBattery() != null)
$battery_id = $cv->getCurrentBattery()->getID();
$wty_ex = '';
$wty_ex = null;
if ($cv->getWarrantyExpiration() != null)
$wty_ex = $cv->getWarrantyExpiration()->format('Y-m-d');