@@ -149,9 +149,9 @@ public static FieldInfo DeclaredField(Type type, string name)
149
149
FileLog . Debug ( "AccessTools.DeclaredField: type is null" ) ;
150
150
return null ;
151
151
}
152
- if ( name is null )
152
+ if ( string . IsNullOrEmpty ( name ) )
153
153
{
154
- FileLog . Debug ( "AccessTools.DeclaredField: name is null" ) ;
154
+ FileLog . Debug ( "AccessTools.DeclaredField: name is null/empty " ) ;
155
155
return null ;
156
156
}
157
157
var fieldInfo = type . GetField ( name , allDeclared ) ;
@@ -183,9 +183,9 @@ public static FieldInfo Field(Type type, string name)
183
183
FileLog . Debug ( "AccessTools.Field: type is null" ) ;
184
184
return null ;
185
185
}
186
- if ( name is null )
186
+ if ( string . IsNullOrEmpty ( name ) )
187
187
{
188
- FileLog . Debug ( "AccessTools.Field: name is null" ) ;
188
+ FileLog . Debug ( "AccessTools.Field: name is null/empty " ) ;
189
189
return null ;
190
190
}
191
191
var fieldInfo = FindIncludingBaseTypes ( type , t => t . GetField ( name , all ) ) ;
@@ -234,9 +234,9 @@ public static PropertyInfo DeclaredProperty(Type type, string name)
234
234
FileLog . Debug ( "AccessTools.DeclaredProperty: type is null" ) ;
235
235
return null ;
236
236
}
237
- if ( name is null )
237
+ if ( string . IsNullOrEmpty ( name ) )
238
238
{
239
- FileLog . Debug ( "AccessTools.DeclaredProperty: name is null" ) ;
239
+ FileLog . Debug ( "AccessTools.DeclaredProperty: name is null/empty " ) ;
240
240
return null ;
241
241
}
242
242
var property = type . GetProperty ( name , allDeclared ) ;
@@ -338,9 +338,9 @@ public static PropertyInfo Property(Type type, string name)
338
338
FileLog . Debug ( "AccessTools.Property: type is null" ) ;
339
339
return null ;
340
340
}
341
- if ( name is null )
341
+ if ( string . IsNullOrEmpty ( name ) )
342
342
{
343
- FileLog . Debug ( "AccessTools.Property: name is null" ) ;
343
+ FileLog . Debug ( "AccessTools.Property: name is null/empty " ) ;
344
344
return null ;
345
345
}
346
346
var property = FindIncludingBaseTypes ( type , t => t . GetProperty ( name , all ) ) ;
@@ -446,9 +446,9 @@ public static MethodInfo DeclaredMethod(Type type, string name, Type[] parameter
446
446
FileLog . Debug ( "AccessTools.DeclaredMethod: type is null" ) ;
447
447
return null ;
448
448
}
449
- if ( name is null )
449
+ if ( string . IsNullOrEmpty ( name ) )
450
450
{
451
- FileLog . Debug ( "AccessTools.DeclaredMethod: name is null" ) ;
451
+ FileLog . Debug ( "AccessTools.DeclaredMethod: name is null/empty " ) ;
452
452
return null ;
453
453
}
454
454
MethodInfo result ;
@@ -495,9 +495,9 @@ public static MethodInfo Method(Type type, string name, Type[] parameters = null
495
495
FileLog . Debug ( "AccessTools.Method: type is null" ) ;
496
496
return null ;
497
497
}
498
- if ( name is null )
498
+ if ( string . IsNullOrEmpty ( name ) )
499
499
{
500
- FileLog . Debug ( "AccessTools.Method: name is null" ) ;
500
+ FileLog . Debug ( "AccessTools.Method: name is null/empty " ) ;
501
501
return null ;
502
502
}
503
503
MethodInfo result ;
@@ -857,9 +857,9 @@ public static Type Inner(Type type, string name)
857
857
FileLog . Debug ( "AccessTools.Inner: type is null" ) ;
858
858
return null ;
859
859
}
860
- if ( name is null )
860
+ if ( string . IsNullOrEmpty ( name ) )
861
861
{
862
- FileLog . Debug ( "AccessTools.Inner: name is null" ) ;
862
+ FileLog . Debug ( "AccessTools.Inner: name is null/empty " ) ;
863
863
return null ;
864
864
}
865
865
return FindIncludingBaseTypes ( type , t => t . GetNestedType ( name , all ) ) ;
@@ -1722,7 +1722,6 @@ public static DelegateType MethodDelegate<DelegateType>(string typeColonName, ob
1722
1722
{
1723
1723
var method = DeclaredMethod ( typeColonName ) ;
1724
1724
return MethodDelegate < DelegateType > ( method , instance , virtualCall ) ;
1725
-
1726
1725
}
1727
1726
1728
1727
/// <summary>Creates a delegate for a given delegate definition, attributed with [<see cref="HarmonyLib.HarmonyDelegate"/>]</summary>
0 commit comments