File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -396,13 +396,20 @@ def parse_item(item):
396396 # an O(N) complexity) instead of the command.
397397 if isinstance (item [3 ], list ):
398398 result ["command" ] = space .join (item [3 ])
399- result ["client_address" ] = item [4 ]
400- result ["client_name" ] = item [5 ]
399+
400+ # These fields are optional, depends on environment.
401+ if len (item ) >= 6 :
402+ result ["client_address" ] = item [4 ]
403+ result ["client_name" ] = item [5 ]
401404 else :
402405 result ["complexity" ] = item [3 ]
403406 result ["command" ] = space .join (item [4 ])
404- result ["client_address" ] = item [5 ]
405- result ["client_name" ] = item [6 ]
407+
408+ # These fields are optional, depends on environment.
409+ if len (item ) >= 7 :
410+ result ["client_address" ] = item [5 ]
411+ result ["client_name" ] = item [6 ]
412+
406413 return result
407414
408415 return [parse_item (item ) for item in response ]
You can’t perform that action at this time.
0 commit comments