Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2604 - Request to range-check ColorPaletteIndex
Summary: Request to range-check ColorPaletteIndex
Status: RESOLVED FIXED
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: PC All
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-17 05:45 EDT by christopher ireland
Modified: 2023-04-17 05:47 EDT (History)
0 users

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description christopher ireland 2023-04-17 05:45:34 EDT
Request made in this post:
https://steema.com/support/viewtopic.php?f=4&t=17890&p=79420#p79420
Comment 1 christopher ireland 2023-04-17 05:47:36 EDT
diff --git a/TeeChart/Editors/Gallery/ChartGallery.cs b/TeeChart/Editors/Gallery/ChartGallery.cs
index 6c4a254b..8dbb5af0 100644
--- a/TeeChart/Editors/Gallery/ChartGallery.cs
+++ b/TeeChart/Editors/Gallery/ChartGallery.cs
@@ -528,7 +528,7 @@ namespace Steema.TeeChart.Editors
                 gallery.Parent = tab.SelectedTab;
                 gallery.Dock = DockStyle.Fill;
 
-                if (GalleryPanel.ColorPaletteIndex > -1)
+                if (GalleryPanel.ColorPaletteIndex > -1 && GalleryPanel.ColorPaletteIndex < Themes.Theme.ColorPalettes.Count)
                     cbGalleryPalette.SelectedIndex = GalleryPanel.ColorPaletteIndex;
                 else
                     cbGalleryPalette.SelectedIndex = 13;