From 95ecda6c51c197c3171c0784583d079b3ae5ff67 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sat, 31 Jul 2021 00:05:59 +0000
Subject: [PATCH] [common] Fix deepMerge() as typeof null is object

---
 common.js  |    2 +-
 index.html |    2 +-
 map.html   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common.js b/common.js
index 3f7be8a..a07cbd5 100644
--- a/common.js
+++ b/common.js
@@ -123,7 +123,7 @@
  **********/
 
 function deepMerge(a1, a2) {
-	if(typeof a1 !== 'object' || typeof a2 !== 'object') {
+	if(a1 === null || typeof a1 !== 'object' || a2 === null || typeof a2 !== 'object') {
 		return a2;
 	}
 	Object.keys(a2).forEach(function (key) {
diff --git a/index.html b/index.html
index d4523ca..8e3d2db 100644
--- a/index.html
+++ b/index.html
@@ -136,7 +136,7 @@
 		</div>
 		<script src="https://polyfill.io/v3/polyfill.min.js?features=Promise,XMLHttpRequest"></script>
 		<script type="text/javascript" src="lang_pl.js?v11" id="lang_script"></script>
-		<script type="text/javascript" src="common.js?v12"></script>
+		<script type="text/javascript" src="common.js?v13"></script>
 		<script type="text/javascript" src="index.js?v8"></script>
 	</body>
 </html>
diff --git a/map.html b/map.html
index 8602b68..a3fa655 100644
--- a/map.html
+++ b/map.html
@@ -21,7 +21,7 @@
 <script src="https://polyfill.io/v3/polyfill.min.js?features=Array.prototype.forEach,Array.prototype.includes,Array.prototype.map,Element.prototype.classList,Promise,String.prototype.startsWith,XMLHttpRequest,requestAnimationFrame"></script>
 <script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.6.1/build/ol.js" integrity="sha384-2t8P2Mt0pPrLNwMqTljtykP6hpy7mzd34amfOqUYKK74XwsZgukowi3L4lW4bd3K" crossorigin="anonymous"></script>
 <script tyle="text/javascript" src="lang_pl.js?v11" id="lang_script"></script>
-<script tyle="text/javascript" src="common.js?v12"></script>
+<script tyle="text/javascript" src="common.js?v13"></script>
 <script tyle="text/javascript" src="map.js?v28"></script>
 </body>
 </html>

--
Gitblit v1.9.1