Skip to content
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] NRE thrown on purge all cache files #3809

Closed
GreenKeldeo opened this issue Mar 11, 2023 · 1 comment · Fixed by #3810
Closed

[Bug] NRE thrown on purge all cache files #3809

GreenKeldeo opened this issue Mar 11, 2023 · 1 comment · Fixed by #3810
Labels
Bug GUI Issues affecting the interactive GUI

Comments

@GreenKeldeo
Copy link

GreenKeldeo commented Mar 11, 2023

Background

  • Operating System: Windows 11 Home 64-bit (10.0, Build 22621) (22621.ni_release.220506-1250)
  • CKAN Version: 1.31.1
  • KSP Version: 1.12.5 (Although I don't think it matters here)

Have you made any manual changes to your GameData folder (i.e., not via CKAN)? Yes, but not to the CKAN cache - nor do I have the CKAN cache open elsewhere.

Problem

Describe the bug
With a 12.8gb CKAN cache, purge all throws an NRE.

Steps to reproduce

  • Open CKAN
  • Go to CKAN settings
  • Press purge
  • Select purge all

Expected behavior
Cache files are purged

Screenshots (if applicable)
image

CKAN error code (if applicable): N/A; Exception text can be found below:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at CKAN.GUI.Contents._UpdateModContentsTree(CkanModule module, Boolean force)
   at CKAN.GUI.SettingsDialog.PurgeAllMenuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
@HebaruSan HebaruSan added Bug GUI Issues affecting the interactive GUI labels Mar 11, 2023
@HebaruSan
Copy link
Member

This should be an easy one. PurgeAllMenuItem_Click passes null:

// finally, clear the preview contents list
Main.Instance.UpdateModContentsTree(null, true);

and _UpdateModContentsTree tries to access a property on it:

private void _UpdateModContentsTree(CkanModule module, bool force = false)
{
ContentsPreviewTree.BackColor = SystemColors.Window;
ContentsPreviewTree.LineColor = SystemColors.WindowText;
if (Equals(module, currentModContentsModule) && !force)
{
return;
}
else
{
currentModContentsModule = module;
}
if (module.IsMetapackage)

@HebaruSan HebaruSan changed the title [Bug] NRE Thrown on purge all cache files [Bug] NRE thrown on purge all cache files Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants