VirtualBox

Ignore:
Timestamp:
Aug 30, 2018 1:19:36 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/rest: Fixed empty array & map handling by making the begin iteration functions return VERR_JSON_IS_EMPTY rather than letter the query method do that. Made query parameter processing table driven and made it use the right escapeing. bugref:9167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/json.cpp

    r73956 r73978  
    15181518    RTJSON_TYPECHECK_RETURN(pThis, RTJSONVALTYPE_ARRAY);
    15191519
    1520     return rtJsonIteratorBeginWorker(pThis, phJsonIt);
     1520    if (pThis->Type.Array.cItems > 0)
     1521        return rtJsonIteratorBeginWorker(pThis, phJsonIt);
     1522    return VERR_JSON_IS_EMPTY;
    15211523}
    15221524
     
    15281530    RTJSON_TYPECHECK_RETURN(pThis, RTJSONVALTYPE_OBJECT);
    15291531
    1530     return rtJsonIteratorBeginWorker(pThis, phJsonIt);
     1532    if (pThis->Type.Object.cMembers > 0)
     1533        return rtJsonIteratorBeginWorker(pThis, phJsonIt);
     1534    return VERR_JSON_IS_EMPTY;
    15311535}
    15321536
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette