I am getting a server crash during “call obj.remove” operation in an agent. It happens always on the same attachment. Attachment does get detached, so it’s not a null object. Attachment name is short and does not have any strange letters.
Server is Domino 7.0.3 and I could not reproduce the problem on other servers. Removing the file makes the agent to show “document is corrupt” message. Removing the document makes the agent continue, only to crash later on another attachment (this time web-attached).
Can this happen because the document is somehow corrupt? Any ways to find the document corruption before server crashes? Regular error handling will not work as there is no error to handle.
Forall i In doc.Items
Set item=i
If item.Type=RICHTEXT Then
Set rtitem=item
If Isempty( rtitem.EmbeddedObjects)=False Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
Set obj = doc.GetAttachment(o.Source )
Call obj.ExtractFile( "c:\temp"+obj.Source) 'works ok
Call obj.Remove 'server crashes here
End If
End Forall
End If
End If
End Forall