Skip to content

Commit db6dfb0

Browse files
committed
1 parent 3310d71 commit db6dfb0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/UseCaseMakerApp/frmMain.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,37 +3405,37 @@ public void OnEditableStateChanged(object sender, ItemTextChangedEventArgs e)
34053405
dstElement = model.FindElementByUniqueID((String)dstNode.Tag);
34063406

34073407
// Sorgente e destinazione sono lo stesso elemento
3408-
if(((IIdentificableObject)dstElement).UniqueID ==
3408+
if(srcElement!=null && dstElement!=null && ((IIdentificableObject)dstElement).UniqueID ==
34093409
((IIdentificableObject)srcElement).UniqueID)
34103410
{
34113411
mnuEditPaste.Enabled = false;;
34123412
}
34133413

34143414
if(dstElement.GetType() == typeof(Package) || dstElement.GetType() == typeof(Model))
34153415
{
3416-
if(srcElement.GetType() == typeof(Package))
3416+
if(srcElement != null && srcElement.GetType() == typeof(Package))
34173417
{
34183418
mnuEditPaste.Enabled = true;
34193419
}
34203420
}
34213421
else if(dstElement.GetType() == typeof(Actors))
34223422
{
3423-
if(srcElement.GetType() == typeof(Actors))
3423+
if(srcElement != null && srcElement.GetType() == typeof(Actors))
34243424
{
34253425
mnuEditPaste.Enabled = true;
34263426
}
3427-
if(srcElement.GetType() == typeof(Actor))
3427+
if(srcElement != null && srcElement.GetType() == typeof(Actor))
34283428
{
34293429
mnuEditPaste.Enabled = true;
34303430
}
34313431
}
34323432
else if(dstElement.GetType() == typeof(UseCases))
34333433
{
3434-
if(srcElement.GetType() == typeof(UseCases))
3434+
if(srcElement != null && srcElement.GetType() == typeof(UseCases))
34353435
{
34363436
mnuEditPaste.Enabled = true;
34373437
}
3438-
if(srcElement.GetType() == typeof(UseCase))
3438+
if(srcElement != null && srcElement.GetType() == typeof(UseCase))
34393439
{
34403440
mnuEditPaste.Enabled = true;
34413441
}

0 commit comments

Comments
 (0)