Countable or not, in communication view. (#1321)

* 커뮤니케이션 모듈 내용 중 null 이 반환되는 가능성이 있는 부분 예외 상황 대응

https://github.com/rhymix/rhymix/pull/1309 연관
This commit is contained in:
Min-Soo Kim 2020-06-17 23:00:14 +09:00 committed by GitHub
parent 588f7a6df8
commit 83ce4a8099
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -294,12 +294,16 @@ class communicationView extends communication
$oCommunicationModel = getModel('communication');
// get a group list
$friend_group_list = array();
$tmp_group_list = $oCommunicationModel->getFriendGroups();
$group_count = count($tmp_group_list);
for($i = 0; $i < $group_count; $i++)
if (is_countable($tmp_group_list))
{
$friend_group_list[$tmp_group_list[$i]->friend_group_srl] = $tmp_group_list[$i];
$group_count = count($tmp_group_list);
for($i = 0; $i < $group_count; $i++)
{
$friend_group_list[$tmp_group_list[$i]->friend_group_srl] = $tmp_group_list[$i];
}
}
Context::set('friend_group_list', $friend_group_list);
@ -381,6 +385,10 @@ class communicationView extends communication
// get a group list
$friend_group_list = $oCommunicationModel->getFriendGroups();
if(!is_countable($friend_group_list))
{
$friend_group_list = array();
}
Context::set('friend_group_list', $friend_group_list);
$this->setTemplateFile('add_friend');