Skip to content

Commit

Permalink
fix: checks on kafka startingpositiontimestamp param
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Iasella committed Nov 4, 2022
1 parent fe3b9e6 commit 3b8b94a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/plugins/aws/package/compile/events/kafka.js
Expand Up @@ -154,7 +154,7 @@ class AwsCompileKafkaEvents {
const startingPosition = event.kafka.startingPosition || 'TRIM_HORIZON';
const startingPositionTimestamp = event.kafka.startingPositionTimestamp;

if (startingPosition === 'AT_TIMESTAMP' && !startingPositionTimestamp) {
if (startingPosition === 'AT_TIMESTAMP' && startingPositionTimestamp != null) {
throw new ServerlessError(
`You must specify startingPositionTimestamp for function: ${functionName} when startingPosition is AT_TIMESTAMP.`,
'FUNCTION_KAFKA_STARTING_POSITION_TIMESTAMP_INVALID'
Expand Down Expand Up @@ -254,7 +254,7 @@ class AwsCompileKafkaEvents {
};
}

if (startingPositionTimestamp !== undefined) {
if (startingPositionTimestamp != null) {
kafkaResource.Properties.StartingPositionTimestamp = startingPositionTimestamp;
}

Expand Down

0 comments on commit 3b8b94a

Please sign in to comment.