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

Summary: Request to range-check ColorPaletteIndex
Product: .NET TeeChart Reporter: christopher ireland <chris>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

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;