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 {
77
77
78
78
task. waitUntilExit ( )
79
79
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
81
82
} catch {
82
83
return error. localizedDescription
83
84
}
@@ -109,7 +110,7 @@ public struct ShellExecutor: ShellExecuting {
109
110
outputQueue. async ( group: group, qos: . userInitiated) {
110
111
// Pull out the STDOUT as a string because we'll need that regardless
111
112
let stdoutData = stdout. fileHandleForReading. readDataToEndOfFile ( )
112
- stdoutString = String ( data: stdoutData, encoding: . utf8) !
113
+ stdoutString = String ( data: stdoutData, encoding: . utf8) ?? " "
113
114
}
114
115
115
116
outputQueue. async ( group: group, qos: . userInitiated) {
You can’t perform that action at this time.
0 commit comments