summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/cmd/mothra/mothra.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/src/cmd/mothra/mothra.c b/sys/src/cmd/mothra/mothra.c
index c6457f547..29e9219fd 100644
--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -1016,9 +1016,11 @@ mothon(Www *w, int on)
plrtstr(&t->next, 0, 0, t->font, strdup("->"), PL_HOT, ap);
t->next->next = x;
} else {
- t->next = x->next;
- x->next = nil;
- freetext(x);
+ if(x) {
+ t->next = x->next;
+ x->next = nil;
+ freetext(x);
+ }
}
}
updtext(w);