Skip to content

Missing null Check for EVABoundFix.Hook(KerbalEVA eva) #15

Description

@tinygrox

https://github.com/linuxgurugamer/Through-The-Eyes/blob/22d43b2eaa8adcab01e604686e4b3e295f490389/ThroughTheEyes/EVABoundFix.cs#L10-L14

In the method EVABoundFix.Hook(KerbalEVA eva), there is no null check for the eva parameter, which can lead to a NullReferenceException when the following line is executed:

https://github.com/linuxgurugamer/Through-The-Eyes/blob/22d43b2eaa8adcab01e604686e4b3e295f490389/ThroughTheEyes/FirstPersonEVA.cs#L137

ThroughTheEyes.GetKerbalEVAFromVessel(pVessel) absolutely could be null:

https://github.com/linuxgurugamer/Through-The-Eyes/blob/22d43b2eaa8adcab01e604686e4b3e295f490389/ThroughTheEyes/ThroughTheEyes.cs#L19-L42

In addition to the null check issue, I’m also unclear on the purpose of the Hook() method. Currently, the method only instantiates a new EVABoundFix object and assigns it to a temporary variable temp, which is not used anywhere.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions