Skip to content

Commit

Permalink
Check for null before splitting string
Browse files Browse the repository at this point in the history
  • Loading branch information
Blair55 committed Nov 3, 2020
1 parent c7e30e0 commit a51d917
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Pipelets/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ module String =
let removeWhitespace (s: String) =
if String.IsNullOrEmpty s then s else regexWhitespace.Replace(s, String.Empty)

let split (c: Char) (s: String) = s.Split c |> List.ofArray
let split (c: Char) (s: String) =
if isNull s then [] else s.Split c |> List.ofArray

let caseInsensitiveEquals a b =
String.Equals(a, b, StringComparison.InvariantCultureIgnoreCase)
Expand Down

0 comments on commit a51d917

Please sign in to comment.