Prevent crashing due to clipboard paste