diff options
-rw-r--r-- | src/libthread/channel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libthread/channel.c b/src/libthread/channel.c index 080f84de..4fdf5e50 100644 --- a/src/libthread/channel.c +++ b/src/libthread/channel.c @@ -96,9 +96,8 @@ altcanexec(Alt *a) _Altarray *ar; Channel *c; - if(a->op == CHANNOP) + if(a->op == CHANNOP || (c=a->c) == nil) return 0; - c = a->c; if(c->bufsize == 0){ ar = chanarray(c, otherop(a->op)); return ar && ar->n; @@ -119,6 +118,8 @@ altqueue(Alt *a) { _Altarray *ar; + if(a->c == nil) + return; ar = chanarray(a->c, a->op); addarray(ar, a); } |