Skip to content

Commit 811b289

Browse files
committed
Forbid calls to .IsEnabled() with NONE
1 parent 3464e73 commit 811b289

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

collector/lib/ExternalIPsConfig.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22

3+
#include <assert.h>
34
#include <optional>
45
#include <ostream>
56

@@ -18,7 +19,10 @@ class ExternalIPsConfig {
1819
};
1920

2021
// Are External-IPs enabled in the provided direction ?
21-
bool IsEnabled(Direction direction) const { return (direction & direction_enabled_) == direction; }
22+
bool IsEnabled(Direction direction) const {
23+
assert(direction != Direction::NONE);
24+
return (direction & direction_enabled_) == direction;
25+
}
2226

2327
// Direction in which External-IPs are enabled
2428
Direction GetDirection() const { return direction_enabled_; }

0 commit comments

Comments
 (0)