SL-11216: Allow llsd::drill() to accept LLSD() as (empty) path.

Before this change, you had to literally pass LLSD::emptyArray() to get no-op
behavior.
master
Nat Goodspeed 2019-05-31 16:36:14 -04:00
parent 3a9498a8e1
commit 16ef497e18
1 changed files with 3 additions and 2 deletions

View File

@ -691,9 +691,10 @@ namespace llsd
LLSD& drill(LLSD& blob, const LLSD& rawPath)
{
// Treat rawPath uniformly as an array. If it's not already an array,
// store it as the only entry in one.
// store it as the only entry in one. (But let's say Undefined means an
// empty array.)
LLSD path;
if (rawPath.isArray())
if (rawPath.isArray() || rawPath.isUndefined())
{
path = rawPath;
}