Skip to content

Commit

Permalink
Safer behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
zsuraski committed Sep 18, 1999
1 parent 39dbe1d commit 6ddd686
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Zend/zend_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ ZEND_API void *zend_fetch_resource_ex(zval *passed_id, int default_id, char *res
int i;

if (default_id==-1) { /* use id */
if (passed_id->type != IS_RESOURCE) {
if (!passed_id) {
zend_error(E_WARNING, "No %s resource supplied", resource_type_name);
return NULL;
} else if (passed_id->type != IS_RESOURCE) {
zend_error(E_WARNING, "Supplied argument is not a valid %s resource", resource_type_name);
return NULL;
}
Expand Down

0 comments on commit 6ddd686

Please sign in to comment.