fixed the crash when raster layer was selected