diff options
Diffstat (limited to 'ext/sqlite/sqlite.c')
| -rw-r--r-- | ext/sqlite/sqlite.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index f1f8f60a27..f9b47c9a74 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -2819,6 +2819,11 @@ static int sqlite_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */ { sqlite_object *obj = (sqlite_object*) zend_object_store_get_object(object TSRMLS_CC); + if (obj->u.res == NULL) { + zend_throw_exception(sqlite_ce_exception, "Row count is not available for this query", 0 TSRMLS_CC); + return FAILURE; + } + if (obj->u.res->buffered) { * count = obj->u.res->nrows; return SUCCESS; |
