From f897d771a67162c91c52f3047520a37c8766de41 Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz Date: Sun, 22 Apr 2012 22:29:42 +0000 Subject: [PATCH] [GB.XML] * BUG: XSLT.Transform() does not crash anymore if the resulting document is empty. git-svn-id: svn://localhost/gambas/trunk@4659 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.xml/src/xslt/CXSLT.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gb.xml/src/xslt/CXSLT.cpp b/gb.xml/src/xslt/CXSLT.cpp index ea5a2414d..c67f04a96 100755 --- a/gb.xml/src/xslt/CXSLT.cpp +++ b/gb.xml/src/xslt/CXSLT.cpp @@ -86,7 +86,13 @@ BEGIN_METHOD(CXSLT_Transform,GB_OBJECT inputDoc;GB_OBJECT inputStyleSheet) xmlDocDumpFormatMemoryEnc(xmlOutDoc ,&buffer, &size, "UTF-8", 1); Document *outDoc = GBI::New("XmlDocument"); + try{ outDoc->setContent(StringToWString(string((char*)(buffer),size))); + } + catch(HTMLParseException &e) + { + outDoc->setContent(L""); + } GB.ReturnObject(outDoc);