Browse Source

DomkitViewer: fix crash on css save with error

lviguier 6 months ago
parent
commit
337538e4d5
1 changed files with 6 additions and 1 deletions
  1. 6 1
      hrt/impl/DomkitViewer.hx

+ 6 - 1
hrt/impl/DomkitViewer.hx

@@ -322,7 +322,12 @@ class DomkitViewer extends h2d.Object {
 
 		unload();
 		tmpCompMap = compHooks.copy();
-		loadResource(resource);
+		try {
+			loadResource(resource);
+		}
+		catch(e: domkit.Error) {
+			style.cssParser.warnings.push({ msg : e.message, pmin : e.pmin, pmax : e.pmax });
+		}
 
 		var inf = loadComponents(resource);