Skip to content

Commit

Permalink
fix: add null check for actual date/time truncation (wiremock#2466) (w…
Browse files Browse the repository at this point in the history
  • Loading branch information
papiomytoglou authored and henrik242 committed Nov 10, 2023
1 parent ff60422 commit 74d4326
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Thomas Akehurst
* Copyright (C) 2021-2023 Thomas Akehurst
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -47,7 +47,7 @@ public enum DateTimeTruncation {
}

public ZonedDateTime truncate(ZonedDateTime input) {
return fn.apply(input);
return input != null ? fn.apply(input) : null;
}

public Date truncate(Date input) {
Expand Down

0 comments on commit 74d4326

Please sign in to comment.