Fix mail crash when pressing cancel with keyboard

This commit is contained in:
JappaWakka 2025-08-20 10:35:17 +02:00
parent 705ff1582c
commit 1ce82cbc06

View File

@ -433,10 +433,12 @@
End If
Dim text As String = ""
If TakenFromParty = False Then
text = Core.Player.Mails(index - 1).MailText.CropStringToWidth(FontManager.MainFont, 600)
Else
text = TempNewMail.MailText.CropStringToWidth(FontManager.MainFont, 600)
If index <> -1 Then
If TakenFromParty = False Then
text = Core.Player.Mails(index - 1).MailText.CropStringToWidth(FontManager.MainFont, 600)
Else
text = TempNewMail.MailText.CropStringToWidth(FontManager.MainFont, 600)
End If
End If
Dim yPlus As Integer = CInt(FontManager.MainFont.MeasureString(text).Y)