Its definitely better the person did that than have the dog do its business in the cabin. However, if the dog cant hold its bodily functions for that length of a flight, then it quite possibly shouldnt even be flying to begin with. This is why vets recommend restricting what is consumed by the dog prior to the flight to avoid situations such as this.