summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/com_dotnet/com_variant.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 6a5dc9dacb..cae992dbb7 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -100,7 +100,12 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
{
OLECHAR *olestring;
php_com_dotnet_object *obj;
- zend_uchar ztype = (z == NULL ? IS_NULL : Z_TYPE_P(z));
+ zend_uchar ztype = IS_NULL;
+
+ if (z) {
+ ZVAL_DEREF(z);
+ ztype = Z_TYPE_P(z);
+ }
switch (ztype) {
case IS_NULL: