It is safe to sleep with a portable air conditioner on.
As long as your outlet is safe and the portable air conditioner is being vented to the outside it's perfectly safe to sleep with the portable air conditioner on and even leave the portable air conditioner on unattended.
I sleep with my portable air conditioner on in my room every night during the summer and even leave it on when I leave the house to keep my room cool.
I also keep my window air conditioners going in the house at night to help keep the house cool.
Even when I leave the house when it's really hot I leave the window AC on along with the portable AC in my room to keep the house and room cool so I don't come home to a hot house and room.
Portable air conditioners should be on a dedicated outlet when possible as they draw a lot of amperage.
The portable air conditioners and window air conditioners are designed to be run non stop and they have overheat protection that will shut the compressor off if it gets too hot.