Closed DenL closed 2 years ago
I could not reproduce this with a space, a hexadecimal number or a very long text. Unfortunately, I did not have an empty clipboard and could not test this.
the clipboard is not the issue.
var cbValue = ImGui.GetClipboardText() ?? "";
if (int.TryParse(cbValue, out var priceValue) && priceValue > 0)
SetPrice(priceValue);
else
ChatGui.Print("Marketbuddy: Clipboard does not contain a valid price");
any value that is not a positive integer will show an error in the chat.
@DenL do you have Penny Pincher installed?
I do not. I’ve had it happen a few times when I first opened retainer/marketboard. And control click is the first thing I do.
Apologize for making the false assumption.
Let me play around with it to see how I can reliably reproduce.
I sometimes have images in my clipboard. Could this happen in that case?
Edit: yup i just tested it. Did a couple price adjustments via marketbuddy. Use windows snipping shortcut to put an image in my clipboard. Tried a control click->crash.
Can confirm. The ImGui.GetClipboardText() function throws an exception with an image in the clipboard.
Fixed with:
try
{
var cbValue = ImGui.GetClipboardText() ?? "";
if (int.TryParse(cbValue, out var priceValue) && priceValue > 0)
SetPrice(priceValue);
else
throw new Exception();
}
catch (Exception)
{
ChatGui.Print("Marketbuddy: Clipboard does not contain a valid price");
}
Good find. I'll deploy the fix soon. Thanks for the code suggestion as well!
What are you trying to do?
Control click an adjust listing option (by accident) when clipboard does not contain numbers (or empty clipboard?)
What is the expected behavior?
Program doesn't crash.
What actually happened?
FFXIV client crashed
Suggested solution
Not sure what's the expected output here; perhaps throw out an error message and not adjust price listing?
Logs
No response
FFXIV Update