diff options
author | bptato <nincsnevem662@gmail.com> | 2024-03-14 22:07:20 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-03-14 22:07:20 +0100 |
commit | b298f5bb70875150addb978ae3c48da8b4105e40 (patch) | |
tree | 8b324e76a7994cfc4e4d5e28c12b66c4e925e304 /src | |
parent | 96aafe1e56639e4409fb0746d740bf1ca440ba2c (diff) | |
download | chawan-b298f5bb70875150addb978ae3c48da8b4105e40.tar.gz |
client: check if container was found before deleting it
Containers may also be deleted without a connection. More specifically: by mailcap, when it launches an external process without opening the output in a buffer.
Diffstat (limited to 'src')
-rw-r--r-- | src/local/client.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/local/client.nim b/src/local/client.nim index 31acce49..6b52536e 100644 --- a/src/local/client.nim +++ b/src/local/client.nim @@ -472,8 +472,8 @@ proc acceptBuffers(client: Client) = elif container.process != -1: # connecting to buffer process let i = pager.findProcMapItem(container.process) pager.procmap.del(i) - else: # connecting to URL - let i = pager.findConnectingContainer(container) + elif (let i = pager.findConnectingContainer(container); i != -1): + # connecting to URL let stream = pager.connectingContainers[i].stream client.selector.unregister(stream.fd) stream.close() |