diff options
Diffstat (limited to 'libkholidays/kholidays.cpp')
-rw-r--r-- | libkholidays/kholidays.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libkholidays/kholidays.cpp b/libkholidays/kholidays.cpp index 694a32dd5..686b438a0 100644 --- a/libkholidays/kholidays.cpp +++ b/libkholidays/kholidays.cpp @@ -90,7 +90,7 @@ TQString KHolidays::location() const TQString KHolidays::shortText( const TQDate &date ) { TQValueList<KHoliday> lst = getHolidays( date ); - if ( !lst.isEmpty() ) + if ( !lst.isEmpty() ) return lst.first().text; else return TQString::null; } @@ -116,7 +116,7 @@ bool KHolidays::parseFile( const TQDate &date ) TQString KHolidays::getHoliday( const TQDate &date ) { TQValueList<KHoliday> lst = getHolidays( date ); - if ( !lst.isEmpty() ) + if ( !lst.isEmpty() ) return lst.first().text; else return TQString::null; } @@ -124,6 +124,10 @@ TQString KHolidays::getHoliday( const TQDate &date ) TQValueList<KHoliday> KHolidays::getHolidays( const TQDate &date ) { TQValueList<KHoliday> list; + if ( !date.isValid() ) { + return list; + } + if ( !parseFile( date ) ) return list; struct holiday *hd = &holidays[date.dayOfYear()-1]; while ( hd ) { |