For some reason, returning a non-existing bug ID does not cause an error in our production installation. But you could check it like this for example:
On Error Resume Next Set refBug = tdc.BugFactory.Item(refId) 'The following line will cause a suppressed error if the bug does not exist summary = refBug.Field("BG_SUMMARY") If Err.Number = 0 Then 'This went OK, which means the bug exists End if On Error Goto 0