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

NullReferenceException in XwaHookDialog ctor #27

Closed
JeremyAnsel opened this issue Sep 16, 2019 · 2 comments
Closed

NullReferenceException in XwaHookDialog ctor #27

JeremyAnsel opened this issue Sep 16, 2019 · 2 comments

Comments

@JeremyAnsel
Copy link
Contributor

Reported by Darksaber at the XWAUP forum: YOGEME by JaggedFel

In XwaHookDialog.cs, there is this code:

_fileName = mission.MissionPath.Replace(".tie", ".ini");
...
StreamReader srMission = null;
if (File.Exists(_fileName)) srMission = new StreamReader(_fileName);if (srMission != null)
{
    #region read
    …
    #endregion
}

srMission.Close();

When the ini file doesn't exist, srMission is null and a NRE is thrown at srMission.Close().

To fix the issue, place srMission.Close(); at the end of the if (srMission != null) block.

@MikeG621
Copy link
Owner

MikeG621 commented Sep 16, 2019 via email

@MikeG621
Copy link
Owner

Fixed in 2d7678c and released

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