Browse Source

Also check cache length

Andy Baugh 5 năm trước cách đây
mục cha
commit
6f44cb5376
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      lib/TestRail/API.pm

+ 1 - 1
lib/TestRail/API.pm

@@ -310,7 +310,7 @@ sub getUsers {
     my ($self,$project_id) = $check->(@_);
 
     # Return shallow clone of user_cache if set.
-    return [ @{ $self->{'user_cache'} } ] if ref $self->{'user_cache'} eq 'ARRAY';
+    return [ @{ $self->{'user_cache'} } ] if ref $self->{'user_cache'} eq 'ARRAY' && scalar(@{$self->{'user_cache'}});
     my $maybe_project = $project_id ? "/$project_id" : '';
     my $res = $self->_doRequest("index.php?/api/v2/get_users$maybe_project");
     return -500 if !$res || (reftype($res) || 'undef') ne 'ARRAY';