Skip to content

Commit

Permalink
Merge pull request #11 from flownative/10-flow-version-might-not-be-r…
Browse files Browse the repository at this point in the history
…eported

Provide fallback for version of neos/flow
  • Loading branch information
robertlemke authored Jun 24, 2022
2 parents 4376ecd + 00dadcd commit 43333a7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Classes/SentryClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Neos\Flow\Core\Bootstrap;
use Neos\Flow\Error\WithReferenceCodeInterface;
use Neos\Flow\Exception;
use Neos\Flow\Package\Exception\UnknownPackageException;
use Neos\Flow\Package\PackageManager;
use Neos\Flow\Security\Context as SecurityContext;
use Neos\Flow\Session\Session;
Expand Down Expand Up @@ -132,10 +133,16 @@ public function initializeObject(): void
*/
private function setTags(): void
{
$flowVersion = FLOW_VERSION_BRANCH;
$flowVersion = '';
if ($this->packageManager) {
$flowPackage = $this->packageManager->getPackage('Neos.Flow');
$flowVersion = $flowPackage->getInstalledVersion();
try {
$flowPackage = $this->packageManager->getPackage('Neos.Flow');
$flowVersion = $flowPackage->getInstalledVersion();
} catch (UnknownPackageException $e) {
}
}
if (empty($flowVersion)) {
$flowVersion = FLOW_VERSION_BRANCH;
}

$currentSession = null;
Expand Down

0 comments on commit 43333a7

Please sign in to comment.