-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Canary - KryptonCustomPaletteBase --> null reference #1465
Comments
Which version of the toolkit are you using? |
Which Canary version of the toolkit are you using? |
I grab the version from GitHub yesterday, based on your label v90.24.4.113-beta |
The above video does not show anything going wrong. So we need some more info about how & what exactly is happening? private void SetPalette(PaletteBase basePalette)
{
if (basePalette != _basePalette)
{
Debug.Assert(_basePalette != null);
// Unhook from current palette events
if (_basePalette != null)
{
_basePalette.PalettePaint -= OnPalettePaint;
_basePalette.ButtonSpecChanged -= OnButtonSpecChanged;
_basePalette.BasePaletteChanged -= OnBasePaletteChanged;
_basePalette.BaseRendererChanged -= OnBaseRendererChanged;
}
// Remember the new palette
_basePalette = basePalette;
// Make sure the redirector passes requests onto the base palette
_redirector.Target = _basePalette;
// Update the color table we inherit from
ToolMenuStatus.BaseKCT = _basePalette.ColorTable;
// Hook to new palette events
if (_basePalette != null)
{
_basePalette.PalettePaint += OnPalettePaint;
_basePalette.ButtonSpecChanged += OnButtonSpecChanged;
_basePalette.BasePaletteChanged += OnBasePaletteChanged;
_basePalette.BaseRendererChanged += OnBaseRendererChanged;
}
}
} |
I see, but: basePalette is not nullable and should be a valid param to a palette. |
Ok, I'll update my code to be sure that the custom palette is always inialized. |
Hi, I have a reference null exeption in SetPalette(..) method KryptonCustomPaletteBase.cs (ln 5845 - Canary)
I suggest to modify the code initializing the basePalette if null:
Regards,
Angelo
The text was updated successfully, but these errors were encountered: