File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -180,17 +180,20 @@ void QgsSingleBandGrayRendererWidget::setFromRenderer( const QgsRasterRenderer *
180180 {
181181 // band
182182 mGrayBandComboBox ->setBand ( gr->grayBand () );
183- const QgsContrastEnhancement *ce = gr->contrastEnhancement ();
184-
185183 mGradientComboBox ->setCurrentIndex ( mGradientComboBox ->findData ( gr->gradient () ) );
186- // minmax
187- mDisableMinMaxWidgetRefresh = true ;
188- mMinLineEdit ->setText ( QString::number ( ce->minimumValue () ) );
189- mMaxLineEdit ->setText ( QString::number ( ce->maximumValue () ) );
190- mDisableMinMaxWidgetRefresh = false ;
191- // contrast enhancement algorithm
192- mContrastEnhancementComboBox ->setCurrentIndex (
193- mContrastEnhancementComboBox ->findData ( ( int )( ce->contrastEnhancementAlgorithm () ) ) );
184+
185+ const QgsContrastEnhancement *ce = gr->contrastEnhancement ();
186+ if ( ce )
187+ {
188+ // minmax
189+ mDisableMinMaxWidgetRefresh = true ;
190+ mMinLineEdit ->setText ( QString::number ( ce->minimumValue () ) );
191+ mMaxLineEdit ->setText ( QString::number ( ce->maximumValue () ) );
192+ mDisableMinMaxWidgetRefresh = false ;
193+ // contrast enhancement algorithm
194+ mContrastEnhancementComboBox ->setCurrentIndex (
195+ mContrastEnhancementComboBox ->findData ( ( int )( ce->contrastEnhancementAlgorithm () ) ) );
196+ }
194197
195198 mMinMaxWidget ->setFromMinMaxOrigin ( gr->minMaxOrigin () );
196199 }
You can’t perform that action at this time.
0 commit comments