Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 37e46ec

Browse files
committedMay 2, 2011
Skip stats call when configuration lacks servers.
1 parent e60e02e commit 37e46ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

Diff for: ‎php_memcached.c

+5
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,11 @@ PHP_METHOD(Memcached, getStats)
18491849

18501850
MEMC_METHOD_FETCH_OBJECT;
18511851

1852+
if (memcached_server_count(m_obj->memc) == 0) {
1853+
array_init(return_value);
1854+
return;
1855+
}
1856+
18521857
stats = memcached_stat(m_obj->memc, NULL, &status);
18531858
php_memc_handle_error(i_obj, status TSRMLS_CC);
18541859
if (stats == NULL) {

0 commit comments

Comments
 (0)
Please sign in to comment.