File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Sources/DangerShellExecutor Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ public struct ShellExecutor: ShellExecuting {
7777
7878 task. waitUntilExit ( )
7979
80- return String ( data: data, encoding: . utf8) !. trimmingCharacters ( in: . whitespacesAndNewlines)
80+ let result = String ( data: data, encoding: . utf8) . map { $0. trimmingCharacters ( in: . whitespacesAndNewlines) } ?? " "
81+ return result
8182 } catch {
8283 return error. localizedDescription
8384 }
@@ -109,7 +110,7 @@ public struct ShellExecutor: ShellExecuting {
109110 outputQueue. async ( group: group, qos: . userInitiated) {
110111 // Pull out the STDOUT as a string because we'll need that regardless
111112 let stdoutData = stdout. fileHandleForReading. readDataToEndOfFile ( )
112- stdoutString = String ( data: stdoutData, encoding: . utf8) !
113+ stdoutString = String ( data: stdoutData, encoding: . utf8) ?? " "
113114 }
114115
115116 outputQueue. async ( group: group, qos: . userInitiated) {
You can’t perform that action at this time.
0 commit comments