fix crash in editing without current layer (#60411)

fixes #60408
This commit is contained in:
Denis Rouzaud 2025-02-03 20:14:04 +01:00 committed by GitHub
parent 3cca51bfc8
commit 0a87489756
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -493,7 +493,7 @@ void QgsMapToolCapture::setCurrentShapeMapTool( const QgsMapToolShapeMetadata *s
void QgsMapToolCapture::cadCanvasMoveEvent( QgsMapMouseEvent *e )
{
// If we are adding a record to a non-spatial layer, just return
if ( mCaptureModeFromLayer && !canvas()->currentLayer()->isSpatial() )
if ( mCaptureModeFromLayer && ( !canvas()->currentLayer() || !canvas()->currentLayer()->isSpatial() ) )
return;
QgsMapToolAdvancedDigitizing::cadCanvasMoveEvent( e );