From 14a09de2dce4e202003e8f383e3bfb979ee5b45e Mon Sep 17 00:00:00 2001
From: Phil <phil@secdev.org>
Date: Thu, 18 Oct 2007 17:01:18 +0200
Subject: [PATCH] Added arguments check to RandChoice

---
 scapy.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scapy.py b/scapy.py
index 548e60dd..a7980e69 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)
-- 
GitLab