@@ -27,21 +27,28 @@ public override System.Type MappedClass
27
27
{
28
28
get
29
29
{
30
- var ownerFullName = this . component . Owner . MappedClass . FullName ;
31
- var roleName = this . component . RoleName ;
32
- var spare = roleName . Substring ( ownerFullName . Length + 1 ) ;
33
- var parts = spare . Split ( '.' ) ;
34
- var prop = null as PropertyInfo ;
35
- var owner = this . component . Owner . MappedClass ;
36
-
37
- for ( var i = 0 ; i < parts . Length ; ++ i )
30
+ if ( ( this . component != null ) && ( this . component . Owner . MappedClass != null ) )
38
31
{
39
- prop = owner . GetProperty ( parts [ i ] , BindingFlags . NonPublic | BindingFlags . Public | BindingFlags . Instance ) ;
32
+ var ownerFullName = this . component . Owner . MappedClass . FullName ;
33
+ var roleName = this . component . RoleName ;
34
+ var spare = roleName . Substring ( ownerFullName . Length + 1 ) ;
35
+ var parts = spare . Split ( '.' ) ;
36
+ var prop = null as PropertyInfo ;
37
+ var owner = this . component . Owner . MappedClass ;
40
38
41
- owner = prop . PropertyType ;
42
- }
39
+ for ( var i = 0 ; i < parts . Length ; ++ i )
40
+ {
41
+ prop = owner . GetProperty ( parts [ i ] , BindingFlags . NonPublic | BindingFlags . Public | BindingFlags . Instance ) ;
42
+
43
+ owner = prop . PropertyType ;
44
+ }
43
45
44
- return typeof ( IDictionary < string , object > ) . IsAssignableFrom ( prop . PropertyType ) ? typeof ( IDictionary < string , object > ) : typeof ( IDictionary ) ;
46
+ return typeof ( IDictionary < string , object > ) . IsAssignableFrom ( prop . PropertyType ) ? typeof ( IDictionary < string , object > ) : typeof ( IDictionary ) ;
47
+ }
48
+ else
49
+ {
50
+ return typeof ( IDictionary ) ;
51
+ }
45
52
}
46
53
}
47
54
0 commit comments