A receiver may be appointed by the court in which the action is pending, or by the judge thereof, in an action by a mortgagee for the foreclosure of his mortgage and sale of the mortgaged property, where it appears that the mortgaged property is in danger of being lost, removed, or materially injured, or that the conditions of the mortgage have not been performed, and that the property is probably insufficient to discharge the mortgage debt.
SDCL 21-21-2