diff --git a/lib/Alchemy/Phrasea/Command/Setup/Install.php b/lib/Alchemy/Phrasea/Command/Setup/Install.php
index d0442cdb4f..7bacd51010 100644
--- a/lib/Alchemy/Phrasea/Command/Setup/Install.php
+++ b/lib/Alchemy/Phrasea/Command/Setup/Install.php
@@ -111,11 +111,12 @@ class Install extends Command
$this->container['phraseanet.installer']->setPhraseaIndexerPath($indexer);
$this->container['phraseanet.installer']->install($email, $password, $abConn, $serverName, $dataPath, $dbConn, $template, $this->detectBinaries());
-
- $command = $this->getApplication()->find('crossdomain:generate');
- $command->run(new ArrayInput(array(
- 'command' => 'crossdomain:generate'
- )), $output);
+ if (null !== $this->getApplication()) {
+ $command = $this->getApplication()->find('crossdomain:generate');
+ $command->run(new ArrayInput(array(
+ 'command' => 'crossdomain:generate'
+ )), $output);
+ }
$output->writeln("Install successful !");
diff --git a/lib/classes/module/console/systemUpgrade.php b/lib/classes/module/console/systemUpgrade.php
index 371061d057..a66c37350a 100644
--- a/lib/classes/module/console/systemUpgrade.php
+++ b/lib/classes/module/console/systemUpgrade.php
@@ -106,10 +106,12 @@ class module_console_systemUpgrade extends Command
$output->writeln("");
}
- $command = $this->getApplication()->find('crossdomain:generate');
- $command->run(new ArrayInput(array(
- 'command' => 'crossdomain:generate'
- )), $output);
+ if (null !== $this->getApplication()) {
+ $command = $this->getApplication()->find('crossdomain:generate');
+ $command->run(new ArrayInput(array(
+ 'command' => 'crossdomain:generate'
+ )), $output);
+ }
} else {
$output->write('Canceled', true);
}