@@ -152,7 +152,7 @@ private void ParseDll()
152
152
&& ! AddTcpHandler ( type )
153
153
&& ! AddHttpHandler ( type ) )
154
154
{
155
- if ( ( HotfixBridge == null && type . GetInterface ( fullName ) != null ) )
155
+ if ( ( HotfixBridge . IsNull ( ) && type . GetInterface ( fullName ) != null ) )
156
156
{
157
157
var bridge = ( IHotfixBridge ) Activator . CreateInstance ( type ) ;
158
158
@@ -172,7 +172,7 @@ private bool AddHttpHandler(Type type)
172
172
}
173
173
174
174
var attr = ( HttpMessageMappingAttribute ) type . GetCustomAttribute ( typeof ( HttpMessageMappingAttribute ) ) ;
175
- if ( attr == null )
175
+ if ( attr . IsNull ( ) )
176
176
{
177
177
// 不是最终实现类
178
178
return true ;
@@ -197,7 +197,7 @@ private bool AddHttpHandler(Type type)
197
197
private bool AddRpcHandler ( Type type )
198
198
{
199
199
var attribute = ( MessageRpcMappingAttribute ) type . GetCustomAttribute ( typeof ( MessageRpcMappingAttribute ) , true ) ;
200
- if ( attribute == null )
200
+ if ( attribute . IsNull ( ) )
201
201
{
202
202
return false ;
203
203
}
@@ -217,13 +217,13 @@ private bool AddRpcHandler(Type type)
217
217
private bool AddTcpHandler ( Type type )
218
218
{
219
219
var attribute = ( MessageMappingAttribute ) type . GetCustomAttribute ( typeof ( MessageMappingAttribute ) , true ) ;
220
- if ( attribute == null )
220
+ if ( attribute . IsNull ( ) )
221
221
{
222
222
return false ;
223
223
}
224
224
225
225
var msgIdField = ( MessageTypeHandlerAttribute ) attribute . MessageType . GetCustomAttribute ( typeof ( MessageTypeHandlerAttribute ) , true ) ;
226
- if ( msgIdField == null )
226
+ if ( msgIdField . IsNull ( ) )
227
227
{
228
228
return false ;
229
229
}
@@ -348,12 +348,12 @@ internal T GetAgent<T>(BaseComponent component) where T : IComponentAgent
348
348
}
349
349
}
350
350
351
- if ( agent == null )
351
+ if ( agent . IsNull ( ) )
352
352
{
353
353
agent = ( T ) Activator . CreateInstance ( agentType ) ;
354
354
}
355
355
356
- if ( agent == null )
356
+ if ( agent . IsNull ( ) )
357
357
{
358
358
throw new ArgumentNullException ( nameof ( agent ) ) ;
359
359
}
0 commit comments