File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
RabbitMQ.AMQP.Client/Impl Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,16 @@ internal DefaultQueueInfo(string queueName)
3535
3636 internal DefaultQueueInfo ( Map response )
3737 {
38- _name = ( string ) response [ "name" ] ;
38+ if ( response [ "name" ] is string name )
39+ {
40+ _name = name ;
41+ }
42+ else
43+ {
44+ // TODO error?
45+ _name = string . Empty ;
46+ }
47+
3948 _durable = ( bool ) response [ "durable" ] ;
4049 _autoDelete = ( bool ) response [ "auto_delete" ] ;
4150 _exclusive = ( bool ) response [ "exclusive" ] ;
@@ -48,10 +57,12 @@ internal DefaultQueueInfo(Map response)
4857
4958 _leader = ( string ) response [ "leader" ] ;
5059
51- string [ ] ? replicas = ( string [ ] ) response [ "replicas" ] ;
52- if ( replicas . Length > 0 )
60+ if ( response [ "replicas" ] is string [ ] queueReplicas )
5361 {
54- _replicas . AddRange ( replicas ) ;
62+ if ( queueReplicas . Length > 0 )
63+ {
64+ _replicas . AddRange ( queueReplicas ) ;
65+ }
5566 }
5667
5768 _messageCount = ( ulong ) response [ "message_count" ] ;
You can’t perform that action at this time.
0 commit comments