Skip to content

Commit

Permalink
Check if field to count is null
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gr committed Jun 4, 2020
1 parent 1df3cc8 commit a953747
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ var powershell = (function () {
// countChunksDelimitedBy will return the number of chunks contained in a field
// that are delimited by the given delimiter.
var countChunksDelimitedBy = function(evt, fromField, delimiter) {
return evt.Get(fromField).split(delimiter).length-1;
var str = evt.Get(fromField);
if (!str) {
return 0;
}
return str.split(delimiter).length-1;
};

var dissect4xxAnd600 = function (evt) {
Expand Down

0 comments on commit a953747

Please sign in to comment.