From e2c44b99a7e668d756afaab10d523be2658bc2fc Mon Sep 17 00:00:00 2001
From: Dirk Loss <mail@dirk-loss.de>
Date: Sat, 19 Sep 2009 20:32:22 +0200
Subject: [PATCH] Fixed exception in canvas_dump() when fval was 0

---
 scapy/packet.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scapy/packet.py b/scapy/packet.py
index 5ee093f3..1d6a7d2c 100644
--- a/scapy/packet.py
+++ b/scapy/packet.py
@@ -468,7 +468,7 @@ Creates an EPS file describing a packet. If filename is not provided a temporary
             for fname, fval, fdump in fields:
                 col = forecolor.next()
                 ft = pyx.text.text(XSTART, (YTXT-y)*YMUL, r"\font\cmssfont=cmss10\cmssfont{%s}" % tex_escape(fname.name))
-                if fval is not None:
+                if isinstance(fval, str):
                     if len(fval) > 18:
                         fval = fval[:18]+"[...]"
                 else:
-- 
GitLab