Samsung’s new flagship smartphone, the Galaxy S7, apparently includes a built in safety feature that will stop you from ruining the phone.

It looks like the  new feature from Samsung could save a lot of handsets from being fried. The Galaxy S7 and Galaxy S7 Edge include warnings that tell you not to charge the phone if it is wet.

Samsung Galaxy S7 Will Tell You When It's Wet

Samsung Galaxy S7 features dirt and water resistant case

The Samsung Galaxy S7 received an IP68 rating for its case, which means it is protected against dirt and water. It did so despite the fact that the micro USB charging port is exposed, but now it sounds as though Samsung has thought about the danger that poses.

As reported by an XDA Developer user, an error message appears if you try to charge the phone while wet. “Moisture detected in charging port,” reads the message, which appeared after the user “took an underwater photo” and then tried to charge their phone.

It looks as though the Galaxy S7 has sensors built into the phone so that it doesn’t get fried by charging when wet, which would be a new safety feature that no one has heard about before. However other users apparently did not see the error message when they tried to charge their handset while wet.

No guarantee that case will remain waterproof

While the phone may have received an IP rating, that does not mean that you should take it swimming with you, or try to test the limits of its protection by dunking it in drinks. Other manufacturers have previously stated that IP ratings simply mean that a device has met safety standards in test environments.

There is no guarantee that it will be water resistant in everyday situations. Doing anything strange with your phone might also void your warranty, so be careful. It’s better to treat the IP rating as a safety net rather than encourage party tricks.

Samsung is hoping that the Galaxy S7 will beat the iPhone in the high-end smartphone market, and at least this way it will head off complaints that phones have been damaged by charging when wet.