File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -66,19 +66,15 @@ class CovTreeDecoder: public AbstractTreeDecoder {
66
66
67
67
struct JsonParser ::Private {
68
68
InStream &input;
69
- bool jsonValid;
70
- AbstractTreeDecoder *decoder;
69
+ AbstractTreeDecoder *decoder = nullptr ;
71
70
pt::ptree root;
72
- const pt::ptree *defList;
71
+ const pt::ptree *defList = nullptr ;
73
72
pt::ptree::const_iterator defIter;
74
- int defNumber;
73
+ int defNumber = 0 ;
75
74
TScanProps scanProps;
76
75
77
76
Private (InStream &input):
78
- input (input),
79
- jsonValid (false ),
80
- decoder (0 ),
81
- defNumber (0 )
77
+ input (input)
82
78
{
83
79
}
84
80
@@ -127,8 +123,8 @@ JsonParser::JsonParser(InStream &input):
127
123
d->decoder ->readRoot (&d->defList , node);
128
124
129
125
// initialize the traversal through the list of defects/issues
130
- d-> defIter = d->defList -> begin ();
131
- d->jsonValid = true ;
126
+ if ( d->defList )
127
+ d->defIter = d-> defList -> begin () ;
132
128
}
133
129
catch (pt::file_parser_error &e) {
134
130
d->input .handleError (e.message (), e.line ());
@@ -172,7 +168,7 @@ bool JsonParser::Private::readNext(Defect *def)
172
168
173
169
bool JsonParser::getNext (Defect *def)
174
170
{
175
- if (!d->jsonValid )
171
+ if (!d->defList )
176
172
return false ;
177
173
178
174
// error recovery loop
You can’t perform that action at this time.
0 commit comments