Skip to content

Commit

Permalink
continue on read failure
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc committed Dec 14, 2024
1 parent c88a1dc commit bc5fbb9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/SDK/Resource/Detectors/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ private function getLinuxId(): ?string
if (is_file($file) && is_readable($file)) {
$contents = file_get_contents($file);

return $contents !== false ? trim($contents) : null;
if ($contents === false) {
continue;
}

return trim($contents);
}
} catch (Throwable $t) {
//do nothing
Expand All @@ -77,7 +81,9 @@ private function getBsdId(): ?string
if (is_file($file) && is_readable($file)) {
$contents = file_get_contents($file);

return $contents !== false ? trim($contents) : null;
if ($contents !== false) {
return trim($contents);
}
}
} catch (Throwable $t) {
//do nothing
Expand Down

0 comments on commit bc5fbb9

Please sign in to comment.