Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Splunk.Client/Splunk/Client/AtomEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,21 @@ static async Task<dynamic> ParseDictionaryAsync(XmlReader reader, int level)
string propertyName;
dynamic propertyValue;

// There are cases where the server sends us bad values for "s:key", namely
// the empty string. This happens for example when we get back the metadata for
// a search job which contains an "eval". In these cases, we simply replace the
// empty string with a literal string called "empty", so that we know where it came
// from.
//
// The risk with this fix is that we will have multiple empty keys at the same
// level, and thus using "empty" would clash. However, this would be an even more
// serious error on the part of the API, as it would mean we have no way to disambiguate
// those two entries. As such, we feel it is safe.
if (names[names.Length - 1] == "")
{
names[names.Length - 1] = "empty";
}

for (int i = 0; i < names.Length - 1; i++)
{
propertyName = NormalizePropertyName(names[i]);
Expand Down