Skip to content

Commit

Permalink
add empty and null guard for Event
Browse files Browse the repository at this point in the history
  • Loading branch information
tbradellis committed Aug 21, 2020
1 parent cc53239 commit 45db95c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public final class Event implements Telemetry {
* @param attributes The key-value pairs that make up the event.
*/
public Event(String eventType, Attributes attributes, long timestamp) {
if (eventType == null || "".equals(eventType)) {
throw new IllegalArgumentException("eventType must not be empty.");
}
this.eventType = eventType;
this.attributes = attributes;
this.timestamp = timestamp;
Expand Down

0 comments on commit 45db95c

Please sign in to comment.