@@ -3405,37 +3405,37 @@ public void OnEditableStateChanged(object sender, ItemTextChangedEventArgs e)
3405
3405
dstElement = model . FindElementByUniqueID ( ( String ) dstNode . Tag ) ;
3406
3406
3407
3407
// Sorgente e destinazione sono lo stesso elemento
3408
- if ( ( ( IIdentificableObject ) dstElement ) . UniqueID ==
3408
+ if ( srcElement != null && dstElement != null && ( ( IIdentificableObject ) dstElement ) . UniqueID ==
3409
3409
( ( IIdentificableObject ) srcElement ) . UniqueID )
3410
3410
{
3411
3411
mnuEditPaste . Enabled = false ; ;
3412
3412
}
3413
3413
3414
3414
if ( dstElement . GetType ( ) == typeof ( Package ) || dstElement . GetType ( ) == typeof ( Model ) )
3415
3415
{
3416
- if ( srcElement . GetType ( ) == typeof ( Package ) )
3416
+ if ( srcElement != null && srcElement . GetType ( ) == typeof ( Package ) )
3417
3417
{
3418
3418
mnuEditPaste . Enabled = true ;
3419
3419
}
3420
3420
}
3421
3421
else if ( dstElement . GetType ( ) == typeof ( Actors ) )
3422
3422
{
3423
- if ( srcElement . GetType ( ) == typeof ( Actors ) )
3423
+ if ( srcElement != null && srcElement . GetType ( ) == typeof ( Actors ) )
3424
3424
{
3425
3425
mnuEditPaste . Enabled = true ;
3426
3426
}
3427
- if ( srcElement . GetType ( ) == typeof ( Actor ) )
3427
+ if ( srcElement != null && srcElement . GetType ( ) == typeof ( Actor ) )
3428
3428
{
3429
3429
mnuEditPaste . Enabled = true ;
3430
3430
}
3431
3431
}
3432
3432
else if ( dstElement . GetType ( ) == typeof ( UseCases ) )
3433
3433
{
3434
- if ( srcElement . GetType ( ) == typeof ( UseCases ) )
3434
+ if ( srcElement != null && srcElement . GetType ( ) == typeof ( UseCases ) )
3435
3435
{
3436
3436
mnuEditPaste . Enabled = true ;
3437
3437
}
3438
- if ( srcElement . GetType ( ) == typeof ( UseCase ) )
3438
+ if ( srcElement != null && srcElement . GetType ( ) == typeof ( UseCase ) )
3439
3439
{
3440
3440
mnuEditPaste . Enabled = true ;
3441
3441
}
0 commit comments