From 76a7aa4df7ad61cc08f32a65b34af8cc899c5fd7 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Fri, 5 Mar 2010 20:03:16 +0100 Subject: [PATCH] fix crash when PIL doesn't recognize the image format --- pyweb/mumble/MumbleCtlIce.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyweb/mumble/MumbleCtlIce.py b/pyweb/mumble/MumbleCtlIce.py index 3500a50..6ef8dcb 100644 --- a/pyweb/mumble/MumbleCtlIce.py +++ b/pyweb/mumble/MumbleCtlIce.py @@ -543,7 +543,10 @@ class MumbleCtlIce_123(MumbleCtlIce_120): if len(texture) == 0: raise ValueError( "No Texture has been set." ); from StringIO import StringIO - return Image.open( StringIO( texture ) ) + try: + return Image.open( StringIO( texture ) ) + except IOError, err: + raise ValueError( err ) @protectDjangoErrPage def setTexture(self, srvid, mumbleid, infile):