Skip to content

Commit bb9ddfb

Browse files
sebstofabianfett
andauthored
do not force unwrap stdout (#398)
* do not force unwrap Revert a change from #d2bd7f1aae1fc9455b208567ba5d85e42463c82c that caused the plugin to crash * test stdout for nil --------- Co-authored-by: Fabian Fett <[email protected]>
1 parent 65061a6 commit bb9ddfb

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)