diff options
Diffstat (limited to '')
-rw-r--r-- | src/unstable/json.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/unstable/json.cpp b/src/unstable/json.cpp index 273d5d3..adc2706 100644 --- a/src/unstable/json.cpp +++ b/src/unstable/json.cpp | |||
@@ -535,6 +535,14 @@ void Bu::Json::parseObject( char &c, Bu::Stream &sInput ) | |||
535 | uDat.pObject = new JsonHash(); | 535 | uDat.pObject = new JsonHash(); |
536 | 536 | ||
537 | next( "object" ); | 537 | next( "object" ); |
538 | |||
539 | // Check to see if it's an empty object. | ||
540 | if( c == '}' ) | ||
541 | { | ||
542 | next("object"); | ||
543 | return; | ||
544 | } | ||
545 | |||
538 | for(;;) | 546 | for(;;) |
539 | { | 547 | { |
540 | Bu::String sKey; | 548 | Bu::String sKey; |
@@ -572,6 +580,13 @@ void Bu::Json::parseArray( char &c, Bu::Stream &sInput ) | |||
572 | 580 | ||
573 | next("array"); | 581 | next("array"); |
574 | 582 | ||
583 | // Check to see if it's an empty array. | ||
584 | if( c == ']' ) | ||
585 | { | ||
586 | next("array"); | ||
587 | return; | ||
588 | } | ||
589 | |||
575 | for(;;) | 590 | for(;;) |
576 | { | 591 | { |
577 | uDat.pArray->append( new Json( c, sInput ) ); | 592 | uDat.pArray->append( new Json( c, sInput ) ); |