Fix issue that caused IniWriter to fail on empty configs

This commit is contained in:
Matthias Jentsch 2015-08-06 17:21:52 +02:00
parent 2a1f0132bc
commit 9b373e9d10
3 changed files with 5 additions and 3 deletions

View File

@ -67,6 +67,7 @@ class Document
*/
public function render()
{
$sections = array();
foreach ($this->sections as $section) {
$sections []= $section->render();
}

View File

@ -7,7 +7,7 @@ class Section
{
/**
* @var string
*
*/
protected $name;
/**

View File

@ -178,8 +178,9 @@ class IniWriter
Logger::warning('Section-less property ' . (string)$directives . ' was ignored.');
continue;
}
$newSection = $newconfig->getSection($section);
if (isset($newSection)) {
if ($newconfig->hasSection($section)) {
$newSection = $newconfig->getSection($section);
$oldDomSection = $doc->getSection($section);
foreach ($directives as $key => $value) {
if ($value instanceof ConfigObject) {