Skip to content

Commit 2a2f5da

Browse files
authored
Empty string behaves like null
1 parent 24d9755 commit 2a2f5da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/AngleSharp.Css/Dom/Internal/MediaList.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public String MediaText
5656
public void SetMediaText(String value, Boolean throwOnError)
5757
{
5858
_media.Clear();
59-
var media = MediaParser.Parse(value ?? CssKeywords.All, ValidatorFactory);
59+
var v = String.IsNullOrEmpty(value) ? CssKeywords.All : value;
60+
var media = MediaParser.Parse(v, ValidatorFactory);
6061

6162
if (media != null)
6263
{

0 commit comments

Comments
 (0)