diff --git a/src/util/colorScale.ts b/src/util/colorScale.ts index 0d5fbac37..a8966fedd 100644 --- a/src/util/colorScale.ts +++ b/src/util/colorScale.ts @@ -117,7 +117,8 @@ export const calcColorScale = ( }; } catch (err) { /* Catch all errors to avoid app crashes */ - console.error("Error creating color scales. Details:\n", err.message); + const errorMessage = err instanceof Error ? err.message : String(err); + console.error("Error creating color scales. Details:\n", errorMessage); return { scale: () => unknownColor, continuous: false,