diff --git a/Source/Source.FilterAPI.php b/Source/Source.FilterAPI.php index 4721c30..6c4d4ed 100644 --- a/Source/Source.FilterAPI.php +++ b/Source/Source.FilterAPI.php @@ -581,7 +581,6 @@ if ( is_null( $s_min ) || is_null( $s_max ) ) { $t_changeset_table = plugin_table( 'changeset' ); - $t_query = "SELECT MIN( timestamp ) AS min, MAX( timestamp ) AS max FROM $t_changeset_table"; $t_result = db_query_bound( $t_query ); @@ -590,6 +589,11 @@ $s_min = $t_row['min'][0]; $s_max = $t_row['max'][0]; + + # Handle the case when there are no changesets in the table + if( is_null( $s_min ) ) { + $s_min = $s_max = idate( 'Y' ); + } } if ( $p_selected == 'now' ) {