Fixes #3 and other unhandled exceptions.

Pressing the copy to clipboard button without anything in the richtext
box produced an ArgumentNullReference exception.