Skip to content

Commit d5f0dc1

Browse files
author
dereuromark
committed
Fix up try catch.
1 parent 36091f5 commit d5f0dc1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Annotator/ModelAnnotator.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@ public function annotate($path) {
2121

2222
$modelName = substr($className, 0, -5);
2323
$plugin = $this->getConfig(static::CONFIG_PLUGIN);
24+
25+
$table = TableRegistry::get($plugin ? ($plugin . '.' . $modelName) : $modelName);
26+
2427
try {
25-
$table = TableRegistry::get($plugin ? ($plugin . '.' . $modelName) : $modelName);
28+
$schema = $table->getSchema();
2629
} catch (Exception $e) {
2730
return null;
2831
}
29-
30-
$schema = $table->getSchema();
31-
if (!$schema) {
32-
return null;
33-
}
34-
32+
3533
$associations = $this->_getAssociations($table->associations());
3634

3735
$entityClassName = $table->getEntityClass();

0 commit comments

Comments
 (0)