From 420303691a62f5c5b3bfad3f194f3840cc43edee Mon Sep 17 00:00:00 2001
From: Bryan de Nijs <b.de.nijs@tmg.nl>
Date: Tue, 15 Nov 2016 17:21:06 +0100
Subject: [PATCH] Issue #2827825: Fix warning illegal offset message

---
 src/SitemapGenerator.php | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/SitemapGenerator.php b/src/SitemapGenerator.php
index 24dba1d..37b11a4 100644
--- a/src/SitemapGenerator.php
+++ b/src/SitemapGenerator.php
@@ -99,10 +99,12 @@ class SitemapGenerator {
   private function getCustomUrlsData() {
     $paths = [];
     foreach ($this->generator->getCustomLinks() as $i => $custom_path) {
-      $paths[$i]['path'] = $custom_path['path'];
-      $paths[$i]['priority'] = isset($custom_path['priority']) ? $custom_path['priority'] : NULL;
-      // todo: implement lastmod.
-      $paths[$i]['lastmod'] = NULL;
+      if (isset($custom_path['path'])) {
+        $paths[$i]['path'] = $custom_path['path'];
+        $paths[$i]['priority'] = isset($custom_path['priority']) ? $custom_path['priority'] : NULL;
+        // todo: implement lastmod.
+        $paths[$i]['lastmod'] = NULL;
+      }
     }
     return $paths;
   }
-- 
2.6.0.windows.1

