File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -152,14 +152,17 @@ void QgsSingleBandGrayRendererWidget::setFromRenderer( const QgsRasterRenderer*
152
152
{
153
153
// band
154
154
mGrayBandComboBox ->setCurrentIndex ( mGrayBandComboBox ->findData ( gr->grayBand () ) );
155
- const QgsContrastEnhancement* ce = gr->contrastEnhancement ();
156
-
157
155
mGradientComboBox ->setCurrentIndex ( mGradientComboBox ->findData ( gr->gradient () ) );
158
- // minmax
159
- mMinLineEdit ->setText ( QString::number ( ce->minimumValue () ) );
160
- mMaxLineEdit ->setText ( QString::number ( ce->maximumValue () ) );
161
- // contrast enhancement algorithm
162
- mContrastEnhancementComboBox ->setCurrentIndex (
163
- mContrastEnhancementComboBox ->findData (( int )( ce->contrastEnhancementAlgorithm () ) ) );
156
+
157
+ const QgsContrastEnhancement* ce = gr->contrastEnhancement ();
158
+ if ( ce )
159
+ {
160
+ // minmax
161
+ mMinLineEdit ->setText ( QString::number ( ce->minimumValue () ) );
162
+ mMaxLineEdit ->setText ( QString::number ( ce->maximumValue () ) );
163
+ // contrast enhancement algorithm
164
+ mContrastEnhancementComboBox ->setCurrentIndex (
165
+ mContrastEnhancementComboBox ->findData (( int )( ce->contrastEnhancementAlgorithm () ) ) );
166
+ }
164
167
}
165
168
}
You can’t perform that action at this time.
0 commit comments