-
-
Notifications
You must be signed in to change notification settings - Fork 345
Windows error after KSP reinstall: Object reference not set to an instance of an object #2443
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
Comments
Possibly caused by Lines 123 to 134 in 5c5cb60
That can happen if we can't find ... and indeed, I can reproduce this if I:
|
@Topperfalkon, thanks for the bug report. What does your reinstall process look like? It looks like you deleted some of the game files but not the main game folder, and then installed the new version somewhere else, since the version info is missing but the CKAN configuration data is still there. We can work on making this code more robust, but you should be able to work around the problem in the meantime by deleting the (old!) main game folder. |
I uninstalled then reinstalled through Steam's UI. I've noticed that Steam doesn't always properly delete folders when you tell it to uninstall games, and it doesn't always detect certain files are missing either. |
Interesting. Can you try the validate local files trick in Steam to see if that helps? If it puts the buildID.txt file back, then that should help. |
I tried deleting buildID.txt (well, renaming) and validating files, but seems to have brought the file back correctly. |
So the file was there before? That should make the reported error impossible. After it brought it back, does the error still happen? |
It's still happening if I open the copy of CKAN that isn't in the install folder, but not the one that's in the KSP root folder. I'm not sure why there's a difference, given that they were literally the same executable |
Hmm, that "NONE" shouldn't look like that; it should have the actual version of the game, like this: (My previous screenshot said NONE because I had deleted the buildID.txt and readme.txt files.) All signs still point to the "working" version being in a folder other than your main Steam folder. Can you show a screenshot of that folder? |
Ah! You're right, the working installation is on my E: drive, though it's a bit weird that CKAN is working fine there, even though it's pointing to a different install. Removing the GameData folder from the old install caused the non-working CKAN executable to prompt me for KSP's location again, and is now working. How weird. I must have reinstalled it to the E: drive instead of the C: drive when I uninstalled it, but Steam clearly didn't clean up the previous installation correctly. |
Cool! Glad you got it working!
Yeah, CKAN has a few features that make this confusing. It will treat its current directory as a KSP folder if it contains GameData, without adding it to the list in the "Select KSP Install" window. So that's what it was doing when you ran it from the folder on E:. Then as a fallback it tries to find your Steam folder, which is added to the list and if that works. And once an instance is in the list, it stays there until you remove it. So that's what it was using when you ran it from the download folder. |
Cool, that makes a lot more sense now. Would be nice to have a bit more hardening for handling edge cases like this. Perhaps forcing the Select KSP Install window to display if it can't find the buildID.txt? Also teaches me to pay more attention when I'm reinstalling things on Steam that they're going to the right place! |
Yeah, I agree. Added that to #2444. |
Background
CKAN Version:
1.25.1
KSP Version:
1.4.3.2152
Operating System:
Windows 10
Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
KSP has been recently reinstalled
Problem
What steps did you take in CKAN?
(After reinstalling KSP)
What did you expect to happen?
I expect my preferences to be saved
What happened instead?
An error is thrown: Object reference not set to an instance of an object
Workaround
Moving ckan.exe to KSP's root folder seems to have resolved the issue
CKAN error codes (if applicable):
N/A, but see Windows exception message below
The text was updated successfully, but these errors were encountered: