Skip to content

Commit 0a82623

Browse files
committed
Update CmdTrait.php
1 parent 9c898ae commit 0a82623

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Ubiquity/devtools/cmd/traits/CmdTrait.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,12 @@ protected static function getSelectedModels($models, $config) {
138138
protected static function updateDomain($options) {
139139
$domain = self::getOption($options, 'o', 'domain', '');
140140
if ($domain != '') {
141-
DDDManager::setDomain($domain);
141+
$domains = DDDManager::getDomains();
142+
if (\array_search($domain, $domains) !== false) {
143+
DDDManager::setDomain($domain);
144+
} else {
145+
throw new \Ubiquity\exceptions\UbiquityException("Domain `$domain` doesn't exist!");
146+
}
142147
}
143148
return $domain;
144149
}

0 commit comments

Comments
 (0)