Skip to content

Commit c71369c

Browse files
committed
test stdout for nil
1 parent 83c3110 commit c71369c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Plugins/AWSLambdaPackager/PluginUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct Utils {
3232

3333
let fd = dup(1)
3434
let stdout = fdopen(fd, "rw")
35-
defer { fclose(stdout) }
35+
defer { if let so = stdout { fclose(so) } }
3636

3737
// We need to use an unsafe transfer here to get the fd into our Sendable closure.
3838
// This transfer is fine, because we write to the variable from a single SerialDispatchQueue here.

0 commit comments

Comments
 (0)