From 5bdbcd38a38f908b1a9ac5e2e96a7805855336e6 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sat, 17 Feb 2024 17:13:14 +0300 Subject: [PATCH] fix null handling in encoding helpers --- Runtime/Scripting/DomProxies/EncodingHelpers.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Runtime/Scripting/DomProxies/EncodingHelpers.cs b/Runtime/Scripting/DomProxies/EncodingHelpers.cs index 5a812ab6..f50f3b98 100644 --- a/Runtime/Scripting/DomProxies/EncodingHelpers.cs +++ b/Runtime/Scripting/DomProxies/EncodingHelpers.cs @@ -10,6 +10,7 @@ public static class EncodingHelpers public static string encodeURI(string input) { + if (input == null) return ""; var len = input.Length; if (len < EscapeLimit) return Uri.EscapeUriString(input); @@ -24,11 +25,13 @@ public static string encodeURI(string input) public static string decodeURI(string input) { + if (input == null) return ""; return Uri.UnescapeDataString(input); } public static string encodeURIComponent(string input) { + if (input == null) return ""; var len = input.Length; if (len < EscapeLimit) return Uri.EscapeDataString(input); @@ -43,6 +46,7 @@ public static string encodeURIComponent(string input) public static string decodeURIComponent(string input) { + if (input == null) return ""; return Uri.UnescapeDataString(input); } }