mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix bug where NULL dates on sqlite cause sigsegv
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18283 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
05a3bfd31b
commit
e0f54bc356
@ -1691,6 +1691,8 @@ load_date( const GncSqlBackend* be, GncSqlRow* row,
|
|||||||
if( G_VALUE_HOLDS_STRING( val ) ) {
|
if( G_VALUE_HOLDS_STRING( val ) ) {
|
||||||
// Format of date is YYYYMMDD
|
// Format of date is YYYYMMDD
|
||||||
const gchar* s = g_value_get_string( val );
|
const gchar* s = g_value_get_string( val );
|
||||||
|
|
||||||
|
if( s != NULL ) {
|
||||||
gchar buf[5];
|
gchar buf[5];
|
||||||
GDateDay day;
|
GDateDay day;
|
||||||
guint month;
|
guint month;
|
||||||
@ -1710,6 +1712,7 @@ load_date( const GncSqlBackend* be, GncSqlRow* row,
|
|||||||
(*setter)( pObject, date );
|
(*setter)( pObject, date );
|
||||||
g_date_free( date );
|
g_date_free( date );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
PWARN( "Unknown date type: %s", G_VALUE_TYPE_NAME( val ) );
|
PWARN( "Unknown date type: %s", G_VALUE_TYPE_NAME( val ) );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user