diff --git a/src/core/raster/qgscolorrampshader.cpp b/src/core/raster/qgscolorrampshader.cpp index 841c71c2728d..0148dbaf317a 100644 --- a/src/core/raster/qgscolorrampshader.cpp +++ b/src/core/raster/qgscolorrampshader.cpp @@ -359,9 +359,6 @@ bool QgsColorRampShader::shade( double value, int *returnRedValue, int *returnGr mLUTInitialized = true; } - if ( mLUT.empty() ) - return false; - // overflow indicates that value > maximum value + DOUBLE_DIFF_THRESHOLD // that way idx can point to the last valid item bool overflow = false; @@ -380,6 +377,10 @@ bool QgsColorRampShader::shade( double value, int *returnRedValue, int *returnGr overflow = true; } } + else if ( lutIndex < 0 ) + { + return false; + } else { // get initial value from LUT