diff src/goodjava/xml/XmlParser.java @ 1723:0246add03d11

dont allow empty xml
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 10 Aug 2022 14:21:15 -0600
parents 35f3bfd4f51d
children a8c685a894b4
line wrap: on
line diff
--- a/src/goodjava/xml/XmlParser.java	Fri Jul 29 14:12:01 2022 -0600
+++ b/src/goodjava/xml/XmlParser.java	Wed Aug 10 14:21:15 2022 -0600
@@ -33,6 +33,8 @@
 		spaces();
 		if( !parser.endOfInput() )
 			throw exception("unexpected text");
+		if( element==null )
+			throw exception("empty document not allowed");
 		return element;
 	}