Skip to content

Commit c59435c

Browse files
committed
Prevent useless looping
1 parent f8ddec8 commit c59435c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

webapp/src/Service/ImportExportService.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,12 @@ protected function convertImportedTime(array $fields, array $data, ?string &$err
110110
$timeValue = null;
111111
$usedField = null;
112112
foreach ($fields as $field) {
113-
if ($timeValue) {
114-
continue;
115-
}
116113
$timeValue = $data[$field] ?? null;
117114
$usedField = $field;
115+
// We need to check as the value for the key can be null
116+
if ($timeValue) {
117+
break;
118+
}
118119
}
119120

120121
if (is_string($timeValue)) {

0 commit comments

Comments
 (0)