Fixed nullref exception if the player clicks yes on the "download sub from the server" prompt after returning to the main menu.

This commit is contained in:
Joonas Rikkonen
2018-07-23 18:37:48 +03:00
parent 4041633eec
commit 4b5a4d66e7

View File

@@ -1532,7 +1532,7 @@ namespace Barotrauma
requestFileBox.Buttons[0].OnClicked += (GUIButton button, object userdata) =>
{
string[] fileInfo = (string[])userdata;
GameMain.Client.RequestFile(FileTransferType.Submarine, fileInfo[0], fileInfo[1]);
GameMain.Client?.RequestFile(FileTransferType.Submarine, fileInfo[0], fileInfo[1]);
return true;
};
requestFileBox.Buttons[1].OnClicked += requestFileBox.Close;