From c5b30ba3bfcb8904eb6b1e66636176997bdca0cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jens=20M=C3=B6nig?= <jens@moenig.org>
Date: Sun, 13 Oct 2024 22:02:53 +0200
Subject: [PATCH] prepared v10.1.4 patch

---
 HISTORY.md     | 8 ++++++++
 src/gui.js     | 2 +-
 src/objects.js | 4 +++-
 sw.js          | 2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/HISTORY.md b/HISTORY.md
index ee08bb4f7..3919df4d8 100755
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -2,6 +2,14 @@
 
 ## in development:
 
+## 10.1.4:
+* **Notable Fixes:**
+    * fixed a dictionary lookup glitch for primitive block palettes
+
+### 2024-09-13
+* objects: fixed another dictionary lookup glitch for primitive palettes 
+* prepared v10.1.4 patch
+
 ## 10.1.3:
 * **Notable Fixes:**
     * fixed a dictionary lookup glitch for custom block categories
diff --git a/src/gui.js b/src/gui.js
index 0f6680288..126aa6723 100644
--- a/src/gui.js
+++ b/src/gui.js
@@ -91,7 +91,7 @@ modules.gui = '2024-October-13';
 
 // Declarations
 
-var SnapVersion = '10.1.3';
+var SnapVersion = '10.1.4';
 
 var IDE_Morph;
 var ProjectDialogMorph;
diff --git a/src/objects.js b/src/objects.js
index aff9c0a28..e82a6221b 100644
--- a/src/objects.js
+++ b/src/objects.js
@@ -4157,7 +4157,9 @@ SpriteMorph.prototype.getPrimitiveTemplates = function (category) {
 };
 
 SpriteMorph.prototype.palette = function (category) {
-    if (!Object.hasOwn(this.paletteCache, category)) {
+    if (!Object.hasOwn(this.paletteCache, category) ||
+        !this.paletteCache[category]
+    ) {
         this.paletteCache[category] = this.freshPalette(category);
     }
     return this.paletteCache[category];
diff --git a/sw.js b/sw.js
index 09cff886b..4d990f471 100644
--- a/sw.js
+++ b/sw.js
@@ -1,6 +1,6 @@
 /*global self, caches*/
 /*jshint esversion: 6*/
-var snapVersion = '10.1.3',
+var snapVersion = '10.1.4',
     cacheName = `snap-pwa-${snapVersion}`,
     filesToCache = [
         'snap.html',