diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-01-18 03:02:10 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:45 +0100 |
commit | 1d4fd42795331fe1cfb8e404f1784cf20f387649 (patch) | |
tree | 3fa4073bfaca8642a89650f1f4b8d83a47d74103 | |
parent | af34e8b4807d981cdd75542c48be741059e91828 (diff) | |
download | usdx-1d4fd42795331fe1cfb8e404f1784cf20f387649.tar.gz usdx-1d4fd42795331fe1cfb8e404f1784cf20f387649.tar.xz usdx-1d4fd42795331fe1cfb8e404f1784cf20f387649.zip |
changed handling of empty list detection
std::list.back() returns undefined values if list is empty
-rw-r--r-- | src/base/song.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/base/song.cpp b/src/base/song.cpp index e1b39360..f596e480 100644 --- a/src/base/song.cpp +++ b/src/base/song.cpp @@ -121,10 +121,8 @@ namespace usdx LyricLine* Song::get_last_lyric_line(void) { - LyricLine* line = lyrics.back(); - - if (line) { - return line; + if (lyrics.size() > 0) { + return lyrics.back(); } return create_new_lyric_line(0); |