The master of a ship may sell the cargo, if the voyage is broken up beyond the possibility of pursuing it, and no other ship can be obtained to carry it to its destination, and the sale is otherwise absolutely necessary.

SOURCE: CC § 2379.