diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-29 22:13:14 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-29 22:13:14 +0100 |
| commit | 2bbceb457f29a1410b99eebbcd42cdb386691b38 (patch) | |
| tree | dfc4556205c31c66fb2b56c2ddf54694c7aa6bc2 /src/Instantiator.cs | |
| parent | 8a25a19ee73e8b7c0c9726bbb2ce4ec918f4e905 (diff) | |
crowObjs type search debug, improve type search in ItemTemplate selection
Diffstat (limited to 'src/Instantiator.cs')
| -rw-r--r-- | src/Instantiator.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Instantiator.cs b/src/Instantiator.cs index 6e94ae17..e738a741 100644 --- a/src/Instantiator.cs +++ b/src/Instantiator.cs @@ -139,10 +139,14 @@ namespace Crow if (t == null) { Assembly a = Assembly.GetEntryAssembly (); foreach (Type expT in a.GetExportedTypes ()) { - if (expT.Name == root) + if (expT.Name == root) { t = expT; + break; + } } } + if (t == null) + throw new Exception ("IML parsing error: undefined root type (" + root + ")"); return t; } void emitLoader (XmlTextReader reader, Context ctx) @@ -324,8 +328,10 @@ namespace Crow if (t == null) { Assembly a = Assembly.GetEntryAssembly (); foreach (Type expT in a.GetExportedTypes ()) { - if (expT.Name == reader.Name) + if (expT.Name == reader.Name) { t = expT; + break; + } } } if (t == null) |