Skip to content
Snippets Groups Projects
Commit 760d191d authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #10111: Fixes segfault on empty config file

parent 94f2eca0
No related branches found
No related tags found
No related merge requests found
......@@ -219,10 +219,7 @@ void YamlParser::processStream()
void YamlParser::processDocument()
{
doc_ = new YamlDocument();
if (!doc_)
throw YamlParserException("Not able to create new document");
doc_ = new YamlDocument;
for (; (eventIndex_ < eventNumber_) and (events_[eventIndex_].type != YAML_DOCUMENT_END_EVENT); ++eventIndex_) {
switch (events_[eventIndex_].type) {
......@@ -366,6 +363,8 @@ void YamlParser::processMapping(YamlNode *topNode)
void YamlParser::constructNativeData()
{
if (!doc_)
throw YamlParserException("YAML Document not initialized");
Sequence *seq = doc_->getSequence();
for (Sequence::iterator iter = seq->begin(); iter != seq->end(); ++iter) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment