In an emergency, we will accept help from any source and in any place, even from an unpleasant person.
any port in a storm
Any solution to a difficult situation (is better than none), as in John's plan isn't ideal, but any port in a storm. This metaphor was first recorded in 1749.