There is currently a question on the front page that is on hold; it is explicitly an off-topic question according to the What topics can I ask about here? page.
However, before the question was put on hold, another user added an answer. It was a fairly good answer, and satisfied the original question. On its merits as an answer alone I would have upvoted it.
However, it's an answer to a question that should not have been asked. If the question were to be edited to be on-topic, the answer would no longer be a suitable answer for the question, and would not deserve an upvote.
What is the right course of action?