Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 7b4ca20

Browse files
committed
prevent NRE"s
1 parent 7d38beb commit 7b4ca20

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/ServiceStack.Text/Common/DeserializeDictionary.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ public static JsonObject ParseJsonObject(string value)
102102

103103
public static Dictionary<string, string> ParseStringDictionary(string value)
104104
{
105+
if (value == null)
106+
return null;
107+
105108
var index = VerifyAndGetStartIndex(value, typeof(Dictionary<string, string>));
106109

107110
var result = new Dictionary<string, string>();

src/ServiceStack.Text/PclExport.Net40.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,9 @@ private static int VerifyAndGetStartIndex(string value, Type createMapType)
10581058

10591059
public static Hashtable ParseHashtable(string value)
10601060
{
1061+
if (value == null)
1062+
return null;
1063+
10611064
var index = VerifyAndGetStartIndex(value, typeof(Hashtable));
10621065

10631066
var result = new Hashtable();

0 commit comments

Comments
 (0)