Explorar o código

Also check cache length

Andy Baugh %!s(int64=5) %!d(string=hai) anos
pai
achega
6f44cb5376
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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';