Prevent fatal error when $friends isn't an array

This commit is contained in:
Hypolite Petovan 2018-11-22 19:03:24 -05:00
parent 03c5c7ca0a
commit 8d7fb35463

View file

@ -57,6 +57,10 @@ function ostatus_subscribe_content(App $a)
$friends = json_decode(PConfig::get($uid, 'ostatus', 'legacy_friends')); $friends = json_decode(PConfig::get($uid, 'ostatus', 'legacy_friends'));
if (empty($friends)) {
$friends = [];
}
$total = sizeof($friends); $total = sizeof($friends);
if ($counter >= $total) { if ($counter >= $total) {