Check class of string being copied to clipboard

Prevents instances of the string being [NSNull null]. Discovered this crash in one of my apps. Not sure how the string being copied to the clipboard became null, but did pass the initial checks. Likely self.text not being initialized. I added some protection to prevent passing [NSNull null] into the pasteboard which will crash the application.