diff --git a/Plugins/AWSLambdaPackager/PluginUtils.swift b/Plugins/AWSLambdaPackager/PluginUtils.swift index 11827200..e12e09dd 100644 --- a/Plugins/AWSLambdaPackager/PluginUtils.swift +++ b/Plugins/AWSLambdaPackager/PluginUtils.swift @@ -32,7 +32,7 @@ struct Utils { let fd = dup(1) let stdout = fdopen(fd, "rw") - defer { fclose(stdout!) } + defer { if let so = stdout { fclose(so) } } // We need to use an unsafe transfer here to get the fd into our Sendable closure. // This transfer is fine, because we write to the variable from a single SerialDispatchQueue here.