diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | history.cpp | 6 |
2 files changed, 5 insertions, 2 deletions
@@ -96,3 +96,4 @@ ____-__-__: Version 0.3.5 - Removed compatibility to VDR < 1.6.0. - Converted documentation and source files to UTF-8. - Added unit tests. +- Fixed segfault in History::current. diff --git a/history.cpp b/history.cpp index 5ed7ec7..d89d0d5 100644 --- a/history.cpp +++ b/history.cpp @@ -1,7 +1,7 @@ /* * Sudoku: A plug-in for the Video Disk Recorder * - * Copyright (C) 2008, Thomas Günther <tom@toms-cafe.de> + * Copyright (C) 2008-2010, Thomas Günther <tom@toms-cafe.de> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,7 +53,9 @@ void History::reset() /** Current move in the history */ Move* History::current() { - return history[executed - 1]; + if (movesExecuted()) + return history[executed - 1]; + return 0; } /** Add a new move */ |