Properly ensure that the token exists and add defensively check for a non-nil value. Closes #4294
Attach a file by drag & drop or click to upload