From 2a2f5da39f9e243eda66e84be9c9e16538886f49 Mon Sep 17 00:00:00 2001 From: Florian Rappl Date: Thu, 16 Feb 2023 09:02:12 +0100 Subject: [PATCH] Empty string behaves like null --- src/AngleSharp.Css/Dom/Internal/MediaList.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AngleSharp.Css/Dom/Internal/MediaList.cs b/src/AngleSharp.Css/Dom/Internal/MediaList.cs index 215b4716..d7b4c942 100644 --- a/src/AngleSharp.Css/Dom/Internal/MediaList.cs +++ b/src/AngleSharp.Css/Dom/Internal/MediaList.cs @@ -56,7 +56,8 @@ public String MediaText public void SetMediaText(String value, Boolean throwOnError) { _media.Clear(); - var media = MediaParser.Parse(value ?? CssKeywords.All, ValidatorFactory); + var v = String.IsNullOrEmpty(value) ? CssKeywords.All : value; + var media = MediaParser.Parse(v, ValidatorFactory); if (media != null) {