31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-06-07 07:50:48 +00:00

Add check for empty data array

This commit is contained in:
Michael Babker 2016-06-25 12:57:24 -05:00
parent 7f838652c7
commit dac2356335

View File

@ -326,10 +326,8 @@ class PullsModel extends \JModelDatabase
}
}
$count = is_array($pulls) ? count($pulls) : 0;
// If there are no pulls to insert then bail, assume we're finished
if ($count === 0 || empty($pulls))
if (count($pulls) === 0)
{
return array('complete' => true);
}
@ -366,6 +364,12 @@ class PullsModel extends \JModelDatabase
}
}
// If there are no pulls to insert then bail, assume we're finished
if (count($data) === 0)
{
return array('complete' => true);
}
$this->getDb()->setQuery(
$this->getDb()->getQuery(true)
->insert('#__patchtester_pulls')