File tree Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -886,22 +886,24 @@ void QgsGrassProvider::loadAttributes ( GLAYER &layer )
886886 #endif
887887
888888 layer.attributes [layer.nAttributes ].values [i] = strdup ( db_get_string (&dbstr) );
889-
890- double dbl;
891- if ( ctype == DB_C_TYPE_INT ) {
892- dbl = db_get_value_int ( value );
893- } else if ( ctype == DB_C_TYPE_DOUBLE ) {
894- dbl = db_get_value_double ( value );
895- } else {
896- dbl = 0 ;
897- }
898-
899- if ( dbl < layer.minmax [i][0 ] ) {
900- layer.minmax [i][0 ] = dbl;
901- }
902- if ( dbl > layer.minmax [i][1 ] ) {
903- layer.minmax [i][1 ] = dbl;
904- }
889+ if ( !db_test_value_isnull (value) )
890+ {
891+ double dbl;
892+ if ( ctype == DB_C_TYPE_INT ) {
893+ dbl = db_get_value_int ( value );
894+ } else if ( ctype == DB_C_TYPE_DOUBLE ) {
895+ dbl = db_get_value_double ( value );
896+ } else {
897+ dbl = 0 ;
898+ }
899+
900+ if ( dbl < layer.minmax [i][0 ] ) {
901+ layer.minmax [i][0 ] = dbl;
902+ }
903+ if ( dbl > layer.minmax [i][1 ] ) {
904+ layer.minmax [i][1 ] = dbl;
905+ }
906+ }
905907 }
906908 layer.nAttributes ++;
907909 }
You can’t perform that action at this time.
0 commit comments