Skip to content

Commit

Permalink
Another fix group type dereference in AttributeManager (NOJIRA)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Jan 1, 2022
1 parent d4f270e commit 744c165
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/src/Lib/Match/AttributeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,16 @@ public function parseFromJSON(\stdClass $json) {
// We have a set of objects of type $k. We group on type.
foreach($v as $vobject) {
// Group is default unless type is set
$g = !empty($vobject['type']) ? $vobject['type'] : '_default';
$g = "_default";

// For some reason, $vobject is an array if it comes over the API,
// or an object if we get here via /matchgrids/reconcile. So for now
// at least we check both.
if(is_array($vobject) && !empty($vobject['type'])) {
$g = $vobject['type'];
} elseif(!empty($vobject->type)) {
$g = !empty($vobject->type);
}

foreach($vobject as $vk => $vv) {
if($vk == 'type') {
Expand Down

0 comments on commit 744c165

Please sign in to comment.