Skip to content

NullReferenceException upon back to Manage mods tab #2584

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

Closed
pcloof opened this issue Nov 23, 2018 · 2 comments
Closed

NullReferenceException upon back to Manage mods tab #2584

pcloof opened this issue Nov 23, 2018 · 2 comments
Labels
Bug Something is not working as intended GUI Issues affecting the interactive GUI Windows Issues specific for Windows

Comments

@pcloof
Copy link

pcloof commented Nov 23, 2018

Background

CKAN Version:
1.25.3

KSP Version:
1.2.2.1622

Also master HEAD

Operating System:
Windows 10, 64 bit

Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
Manually added folder MechJeb2 a while back; used this mod succesfully via manual installation. This is likely irrelevant for the problem.

Problem

What steps did you take in CKAN?

  1. Filter by mod name: "realistic"
  2. Check box for "Realistic Progression Zero", takes you to 'Choose mods' tab
  3. Check bottom item of the three listed real solar system texture options and hit the 'Continue' button

What did you expect to happen?
Going back to the 'Manage mods' tab without any errors.

What happened instead?
Going back to 'Manage mods' tab works, but it immediately shows a popup with a NRE.

Screenshots:
image

CKAN error codes (if applicable):

System.NullReferenceException: Object reference not set to an instance of an object.
   at CKAN.GUIMod.SetInstallChecked(DataGridViewRow row, Nullable`1 set_value_to)
   at CKAN.Main._MarkModForInstall(String identifier, Boolean uninstall)
   at CKAN.Main.<>c__DisplayClass264_0.<MarkModForInstall>b__0()
   at CKAN.Util.Invoke[T](T obj, Action action)
   at CKAN.Main.MarkModForInstall(String identifier, Boolean uncheck)
   at CKAN.Main.<TooManyModsProvide>d__237.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at CKAN.MainModList.<ComputeChangeSetFromModList>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>d__61.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at CKAN.Main.<ModList_CellValueChanged>d__274.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

Workaround that gives a hint about the underlying problem:
From the top of the stack trace, it looks like it has trouble with the check box selection of a row it doesn't find. Based on this, I tried a different approach that didn't produce this error, so a workaround: skip step 1 of the reproduction steps, so do not apply any filter, just scroll to the package, and then apply step 2 and 3. No exception occurs.

The underlying problem seems to be in returning to the filtered mods list. By selecting a textures mod in the 'Choose mods' tab, the program wants to set the check box for this mod to the checked state back in the 'Manage mods' overview, but this mod is not in the list because of the applied filter.

@HebaruSan HebaruSan added GUI Issues affecting the interactive GUI Bug Something is not working as intended labels Nov 23, 2018
@HebaruSan
Copy link
Member

HebaruSan commented Nov 23, 2018

Thanks for the report. Confirmed on the current under dev version, full text of exception added to OP.

row.DataGridView is null here:

CKAN/GUI/GUIMod.cs

Lines 279 to 286 in c4f067b

if ((bool)install_cell.Value != IsInstallChecked)
{
install_cell.Value = IsInstallChecked;
// These calls are needed to force the UI to update,
// otherwise the checkbox will look checked when it's unchecked or vice versa
row.DataGridView.RefreshEdit();
row.DataGridView.Refresh();
}

Those calls were added in #2425.

@HebaruSan
Copy link
Member

Doesn't seem to happen on Linux.

Sorry, something went wrong.

@HebaruSan HebaruSan added the Windows Issues specific for Windows label Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended GUI Issues affecting the interactive GUI Windows Issues specific for Windows
Projects
None yet
Development

No branches or pull requests

2 participants