In this case, by my standards, it already is. Some relatively unrelated bit of code is later failing loudly.
> This is a case where the best is enemy of the good.
Neither best nor good happened in this case - so I'd flip your terms around. The best of intentions and standards prevented good.
> The patch should log a warning/error and avoid the crash. It does not preempt an optimal solution, by traversing the file tree, being developed afterwards.
On this we can agree wholeheartedly. That'd be a great followup changelist in lieu of doing the optimal solution, assuming the latter is too time consuming.