Fix issue that caused IniWriter to fail on empty configs
This commit is contained in:
parent
2a1f0132bc
commit
9b373e9d10
|
@ -67,6 +67,7 @@ class Document
|
|||
*/
|
||||
public function render()
|
||||
{
|
||||
$sections = array();
|
||||
foreach ($this->sections as $section) {
|
||||
$sections []= $section->render();
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ class Section
|
|||
{
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue