brucealdridge/vendapi — pull request #6 by gurubobnz (2013-05-01 04:48:59+00:00)
Title: Don't close curl object if it's not a resource

Check to see if this->curl is a resource before freeing it. It won't be a resource if a number of VendObjects's have been serialized and unserialized.

The following code will get customers from a cache file if present and if it is present a warning is issued. With the patch the warning is not issued.

```php
if( is_file( 'cache.customers' ) )
{
$customers = unserialize( file_get_contents( 'cache.customers' ) );
}
else
{
$customers = $vend->getCustomers();
file_put_contents( 'cache.customers', serialize( $customers ) );
}

var_dump( $customers );
```

Hope this makes sense ;)