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

Tripped over an interesting error message #63

Closed
Mihara opened this issue Jul 20, 2014 · 3 comments
Closed

Tripped over an interesting error message #63

Mihara opened this issue Jul 20, 2014 · 3 comments

Comments

@Mihara
Copy link

Mihara commented Jul 20, 2014

In a log that ended with a crash to desktop, I might add.

InvalidOperationException: Operation is not valid due to the current state of the object
  at System.Linq.Enumerable.First[SCANsat] (IEnumerable`1 source) [0x00000] in <filename unknown>:0 
  at SCANsat.JSISCANsatRPM.Start () [0x00000] in <filename unknown>:0 
 (Filename:  Line: -1)

This happens right when RPM is attempting to load a copy of SCANsat and repeats more than once because there are more monitors in there. The particular culprit is Spaceplane Plus 1.3, running on x64.

Did you, perchance, forget to compile for .NET 3.5? Because I've had problems with LINQ in such cases...

@DMagic1
Copy link
Collaborator

DMagic1 commented Jul 20, 2014

Any chance the SCANsat module is not getting added to the pod for some reason? If you can load the vessel, without going into IVA, right click on it to check if the 'open map' button is there.

Alternatively, is it possible that multiple SCANsat modules are being added? Maybe using another MM config.

If no SCANsat module is present it might be choking when it SCANsatRPM tries to find it. I probably should have used FirstOrDefault() instead of First(), or maybe just use a Try, Catch if that will work in this case.

It should be compiled with .NET 3.5, I'm usually pretty careful to check that. But ModStatistics will warn you if it isn't.

@Mihara
Copy link
Author

Mihara commented Jul 20, 2014

I can't load the vessel because I get a crash to desktop. :) It is not impossible that multiple modules are getting added or no modules are getting added, but you can always make the SCANsatRPM instantiate SCANsat directly - as long as you don't need it to store state, this will work and will prevent all possibility of such a mishap. Look how I did it with RPMC: https://github.com/Mihara/RasterPropMonitor/blob/master/RasterPropMonitor/Core/PropMonitorComputer.cs#L200

EDIT: This was written before RPMC was used to store state, of course, now RPMC is required to be installed if you want to store state.

@DMagic1
Copy link
Collaborator

DMagic1 commented Jul 20, 2014

OK, I see the same error when I removed the RPMMapTraq.cfg file preventing the SCANsat module from being added. I don't get any crashes though, just debug errors for all three screens (using the Mk I pod).

I'm trying to make it more error-resistant now, but like your case, the module is required to store persistent data, so I'm going to just deactivate SCANsatRPM if the module isn't present and print an error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants