In principle, no, it would be sufficient to allow the NaNs to propagate and let the user sort it out at the end. On the other hand, it will save a lot of wasted computation to catch NaNs at a few opertune moments. eg checking that input parameters are finite, checking that a grid search has found something better than it started with, etc. This is particularly true because a minimisation with a NaN input will always run to the full iteration limit (ie. quite a long time).
Is prevention or cure the best course of action?