Skip to content

Possible null ref in SteamNetworkingSocketsTransport.CloseP2PSessions(). #265

@TheJohnGamble

Description

@TheJohnGamble

NetworkManager.Singleton is not guaranteed to exist when calling CloseP2PSessions, such as in the case of exiting play mode while hosting a server. NetworkManager can set its Singleton to null before it is destroyed, which caused a null ref here.

Suggested fix:

Change the line:

if (NetworkManager.Singleton.LogLevel <= LogLevel.Developer)

to

if (NetworkManager.Singleton && NetworkManager.Singleton.LogLevel <= LogLevel.Developer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions