Skip to content

Commit cdd0c10

Browse files
authored
Merge pull request #1384 from hydephp/catch-realtime-compiler-dashboard-out-of-bounds-exception
Catch RealtimeCompiler Dashboard OutOfBoundsException
2 parents 9755d13 + 2177944 commit cdd0c10

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/realtime-compiler/src/Http/DashboardController.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Hyde\RealtimeCompiler\Http;
66

77
use Hyde\Hyde;
8+
use OutOfBoundsException;
89
use Hyde\Pages\Concerns\HydePage;
910
use Hyde\Framework\Actions\StaticPageBuilder;
1011
use Hyde\Framework\Actions\AnonymousViewCompiler;
@@ -46,8 +47,8 @@ public function getProjectInformation(): array
4647
{
4748
return [
4849
'Git Version:' => app('git.version'),
49-
'Hyde Version:' => InstalledVersions::getPrettyVersion('hyde/hyde') ?: 'unreleased',
50-
'Framework Version:' => InstalledVersions::getPrettyVersion('hyde/framework') ?: 'unreleased',
50+
'Hyde Version:' => self::getPackageVersion('hyde/hyde'),
51+
'Framework Version:' => self::getPackageVersion('hyde/framework'),
5152
'Project Path:' => Hyde::path(),
5253
];
5354
}
@@ -169,4 +170,15 @@ protected static function welcomeFrame(): string
169170
</aside>
170171
HTML;
171172
}
173+
174+
protected function getPackageVersion(string $packageName): string
175+
{
176+
try {
177+
$prettyVersion = InstalledVersions::getPrettyVersion($packageName);
178+
} catch (OutOfBoundsException) {
179+
//
180+
}
181+
182+
return $prettyVersion ?? 'unreleased';
183+
}
172184
}

0 commit comments

Comments
 (0)