diff --git a/scapy.py b/scapy.py index 548e60dd898e019fae9095250cf7930f5da5ca54..a7980e6905a0fc37f968f27f85c7a89f4e1608ef 100755 --- a/scapy.py +++ b/scapy.py @@ -1488,6 +1488,8 @@ class RandSLong(RandNum): class RandChoice(RandField): def __init__(self, *args): + if not args: + raise TypeError("RandChoice needs at least one choice") self._choice = args def _fix(self): return random.choice(self._choice)