[gnome-games/gnome-2-32] chess: Fix crash decoding empty SAN string
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/gnome-2-32] chess: Fix crash decoding empty SAN string
- Date: Mon, 2 May 2011 06:06:24 +0000 (UTC)
commit ea9f83a668d3313e998943c53d9ba1d473637d09
Author: Robert Ancell <robert ancell canonical com>
Date: Mon May 2 16:06:18 2011 +1000
chess: Fix crash decoding empty SAN string
glchess/src/lib/chess/san.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/glchess/src/lib/chess/san.py b/glchess/src/lib/chess/san.py
index 182e44b..ebc7d93 100644
--- a/glchess/src/lib/chess/san.py
+++ b/glchess/src/lib/chess/san.py
@@ -107,6 +107,9 @@ class SANConverter:
"""
copy = san[:]
+ if copy == '':
+ raise Error("Empty string")
+
# Look for check hints
expectedResult = True
if copy[-1] == self.CHECK or copy[-1] == self.CHECKMATE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]