]> git.sesse.net Git - xml-template/blobdiff - php5-swig/xml-template.swig
In php5-swig, handle NULLs as empty strings instead of crashing on them in substitute.
[xml-template] / php5-swig / xml-template.swig
index 517595168d99f6e129cd09560502e98b1a08d05a..e39053c0e1f8a7a958c83023f79cb79f51cf1b13 100644 (file)
@@ -76,10 +76,10 @@ Directive* convert_php_objects_to_directive(zval *obj)
                if (SWIG_ConvertPtr(obj, (void **)&doc, SWIGTYPE_p_XmlDocPtrWrapper, 0) < 0 || doc == NULL) {
                        return NULL;
                }
-               return new ReplaceInclude(xmlCopyDoc(doc->get()->ptr, 1));
+               return new ReplaceInclude(xmlCopyDoc((*doc)->ptr, 1));
        }
        case IS_NULL:
-               return NULL;
+               return new Replace { "" };
        default:
                printf("WARNING: Unknown type %d!\n", Z_TYPE_P(obj));
                break;