fix: JsonReader GetValueAsString ignores token type

This commit is contained in:
Chris Cameron
2019-04-01 12:27:06 -04:00
parent 134ee85067
commit 100b8e4753

View File

@@ -148,11 +148,7 @@ namespace ICD.Common.Utils.Extensions
if (extends == null)
throw new ArgumentNullException("extends");
if (extends.TokenType == JsonToken.String || extends.TokenType == JsonToken.Null)
return extends.Value as string;
string message = string.Format("Token {0} {1} is not {2}", extends.TokenType, extends.Value, JsonToken.String);
throw new InvalidCastException(message);
return extends.Value as string;
}
/// <summary>