Skip to content

Commit c633012

Browse files
obonessavornicesei
authored andcommitted
Avoid a NullReferenceException in case of error
1 parent 69290fe commit c633012

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

project/core/Config/preprocessor/ElementProcessors/ImportProcessor.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public override IEnumerable< XNode > Process(XNode node)
2828
}
2929
Type type;
3030
type = assembly != null ? assembly.GetType( type_ref ) : Type.GetType( type_ref );
31+
32+
if (type == null)
33+
{
34+
throw ImportException.CreateException(
35+
"Imported type '{0}' could not be found in '{1}'",
36+
type_ref, assembly_loc);
37+
}
38+
3139
var processor = Activator.CreateInstance( type, _Env ) as IElementProcessor;
3240
if ( processor == null )
3341
{

0 commit comments

Comments
 (0)