Return nil if clipboard does not contain any text

This commit is contained in:
Alessandro Proto 2023-02-18 20:33:25 +01:00
parent ac9081cf89
commit 001ce2f626

View file

@ -130,7 +130,10 @@ public class Machine : IComponent
{
var L = Lua.FromIntPtr(state);
L.PushString(SDL.GetClipboardText());
if (SDL.HasClipboardText())
L.PushString(SDL.GetClipboardText());
else
L.PushNil();
return 1;
}