fix: segmentation fault

This commit is contained in:
speedie 2023-02-10 21:27:02 +01:00
parent d9f88e5ee3
commit 4ef9075dbe

View file

@ -889,18 +889,12 @@ backspace(const Arg *arg)
void void
selectitem(const Arg *arg) selectitem(const Arg *arg)
{ {
char *selection; if (!text)
if (arg->i)
selection = sel->text;
else
selection = text;
if (!sel)
return; return;
puts(selection); puts(text);
savehistory(selection); savehistory(text);
cleanup(); cleanup();
exit(0); exit(0);
} }