Skip to content

Commit 5b6497e

Browse files
authored
Merge pull request #1584 from platformsh/cli-74-error-on-upsun-push-after-local-branch-creation
Fix error on pushing a new branch
2 parents bf375ca + 3751fb9 commit 5b6497e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Command/Environment/EnvironmentPushCommand.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
182182
}
183183
}
184184

185-
if (!$targetEnvironment->operationAvailable('deploy', true)) {
186-
$this->stdErr->writeln(sprintf('Deployment strategy: <info>%s</info>', $strategy ?: "stopstart"));
187-
} else {
188-
$this->stdErr->writeln('The activity will be staged, ignoring the deployment strategy.');
185+
if ($targetEnvironment) {
186+
if (!$targetEnvironment->operationAvailable('deploy', true)) {
187+
$this->stdErr->writeln(sprintf('Deployment strategy: <info>%s</info>', $strategy ?: "stopstart"));
188+
} else {
189+
$this->stdErr->writeln('The activity will be staged, ignoring the deployment strategy.');
190+
}
189191
}
190192

191193
$this->stdErr->writeln('');

0 commit comments

Comments
 (0)