Error in dev.off() : cannot shut down device 1 (the null device)

Okay... it's happened again. I have just restarted again, and it's fine, but having to continually restart RStudio is not convenient.