From 81708a4de75ed318a919fd4925b8221cee1a7bf3 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 25 Mar 2023 07:46:41 -0700 Subject: [PATCH] facerecog: check key in post process Signed-off-by: Varun Patil --- lib/ClustersBackend/FaceRecognitionBackend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ClustersBackend/FaceRecognitionBackend.php b/lib/ClustersBackend/FaceRecognitionBackend.php index 2ddce61d..dc5d93f6 100644 --- a/lib/ClustersBackend/FaceRecognitionBackend.php +++ b/lib/ClustersBackend/FaceRecognitionBackend.php @@ -132,7 +132,7 @@ class FaceRecognitionBackend extends Backend // Post process foreach ($faces as &$row) { - $row['id'] = $row['name'] ?: (int) $row['id']; + $row['id'] = \array_key_exists('name', $row) ? $row['name'] : (int) $row['id']; $row['count'] = (int) $row['count']; }