From ca5b9ff2057b1bcc62ed2d27d67d1007a5e39d05 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 11 Feb 2025 12:09:04 -0600 Subject: [PATCH] isNil check? --- pkgs/oizys/src/oizys/exec.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/oizys/src/oizys/exec.nim b/pkgs/oizys/src/oizys/exec.nim index c8574f6..4ae5540 100644 --- a/pkgs/oizys/src/oizys/exec.nim +++ b/pkgs/oizys/src/oizys/exec.nim @@ -46,17 +46,17 @@ proc runCmdCapt*( result.exitCode = -1 var line: string while true: - if CaptStdout in capture: + if CaptStdout in capture and not isNil(outstrm): if outstrm.readLine(line): result.stdout.add line & '\n' - if CaptStderr in capture: + if CaptStderr in capture and not isNil(errstrm): if errstrm.readLine(line): result.stderr.add line & '\n' result.exitCode = peekExitCode(p) if result.exitCode != -1: - if CaptStdout in capture: + if CaptStdout in capture and not isNil(outstrm): result.stdout.add outstrm.readAll() - if CaptStderr in capture: + if CaptStderr in capture and not isNil(errstrm): result.stderr.add errstrm.readAll() break