Defensive coding: only reset pasteboard string if it is actually a string (seeing strange crashes)