Remove redundant if condition.

is_object(null) is false, so we don't need a separate empty($state) condition.
This commit is contained in:
Yahnis Elsts 2016-12-30 19:44:00 +02:00
parent 8e5bc8c321
commit 36ef731e4f
1 changed files with 2 additions and 4 deletions

View File

@ -203,11 +203,9 @@ if ( !class_exists('Puc_v4_UpdateChecker', false) ):
*/
public function getUpdateState() {
$state = get_site_option($this->optionName, null);
if ( empty($state) || !is_object($state) ) {
if ( !is_object($state) ) {
$state = null;
}
if ( isset($state, $state->update) && is_object($state->update) ) {
} else if ( isset($state->update) && is_object($state->update) ) {
$state->update = call_user_func(array($this->updateClass, 'fromObject'), $state->update);
}
return $state;