[NFC] Fix E-notice in Afform unit tests
authorSeamus Lee <seamuslee001@gmail.com>
Thu, 2 Sep 2021 00:16:26 +0000 (00:16 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Thu, 2 Sep 2021 00:17:02 +0000 (00:17 +0000)
ext/afform/core/Civi/Api4/Action/Afform/Get.php

index 3539d95e721629ae880da7e5f89a30839d4e4264..6a9ae6e68183edefdbc73a241f9392fd3b1eeabb 100644 (file)
@@ -56,7 +56,7 @@ class Get extends \Civi\Api4\Generic\BasicGetAction {
       // Skip if afform does not exist or is not of requested type(s)
       if (
         (!$record && !isset($values[$name])) ||
-        ($getTypes && !in_array($record['type'], $getTypes, TRUE))
+        ($getTypes && isset($record['type']) && !in_array($record['type'], $getTypes, TRUE))
       ) {
         continue;
       }