Skip to content

Commit

Permalink
added guard statement to prevent accidentally sending none file to pa…
Browse files Browse the repository at this point in the history
…rser
  • Loading branch information
thomashorrobin committed Aug 21, 2021
1 parent 75c177a commit f3918f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/SwiftkubeClient/Client/KubernetesClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ public class KubernetesClient {
logger: Logger? = nil
) {
let logger = logger ?? KubernetesClient.loggingDisabled


guard fromURL.isFileURL else {
logger.debug("URL must point to a file")
return nil
}

guard
let config = try? LocalFileConfigLoader(fromURL: fromURL).load(logger: logger)
else {
Expand Down

0 comments on commit f3918f1

Please sign in to comment.