Commits

Anonymous committed 34d41d8

Make sure we deal with errors outside of parsing correctly

  • Participants
  • Parent commits ed767a3

Comments (0)

Files changed (1)

     sv_vsetpvfn(sv, msg, strlen(msg), &args, NULL, 0, NULL);
     va_end(args);
     
-    sv_catsv(LibXML_error, sv); /* remember the last error */
+    if (LibXML_error != NULL) {
+        sv_catsv(LibXML_error, sv); /* remember the last error */
+    }
+    else {
+        croak(SvPV(sv, PL_na));
+    }
     SvREFCNT_dec(sv);
 }
 
     sv_vsetpvfn(sv, msg, strlen(msg), &args, NULL, 0, NULL);
     va_end(args);
     
-    sv_catsv(LibXML_error, sv);
+    if (LibXML_error != NULL) {
+        sv_catsv(LibXML_error, sv); /* remember the last error */
+    }
+    else {
+        croak(SvPV(sv, PL_na));
+    }
     SvREFCNT_dec(sv);
 }