From fe3c2d841b8c112f7f22ac9f7209d46b0c6b9669 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 1 Oct 2024 15:48:45 -0400
Subject: fixed saving to anno palette.

---
 src/client/views/smartdraw/AnnotationPalette.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/client/views/smartdraw/AnnotationPalette.tsx')

diff --git a/src/client/views/smartdraw/AnnotationPalette.tsx b/src/client/views/smartdraw/AnnotationPalette.tsx
index 4421547be..1c17469c3 100644
--- a/src/client/views/smartdraw/AnnotationPalette.tsx
+++ b/src/client/views/smartdraw/AnnotationPalette.tsx
@@ -10,7 +10,7 @@ import { returnEmptyFilter, returnFalse, returnTrue } from '../../../ClientUtils
 import { emptyFunction } from '../../../Utils';
 import { Doc, DocListCast, returnEmptyDoclist } from '../../../fields/Doc';
 import { DocData } from '../../../fields/DocSymbols';
-import { ImageCast } from '../../../fields/Types';
+import { ImageCast, NumCast } from '../../../fields/Types';
 import { DocumentType } from '../../documents/DocumentTypes';
 import { Docs } from '../../documents/Documents';
 import { makeUserTemplateButtonOrImage } from '../../util/DropConverter';
@@ -178,7 +178,7 @@ export class AnnotationPalette extends ObservableReactComponent<AnnotationPalett
      * presses the "save drawing" button.
      */
     saveDrawing = async () => {
-        const cIndex: number = this._props.Document.carousel_index as number;
+        const cIndex = NumCast(this._props.Document.carousel_index);
         const focusedDrawing = DocListCast(this._props.Document.data)[cIndex];
         const docData = focusedDrawing[DocData];
         docData.title = this._opts.text.match(/^(.*?)~~~.*$/)?.[1] || this._opts.text;
-- 
cgit v1.2.3-70-g09d2

