You were probably taught that you shouldn’t use “will” after “if” in conditional clauses, for example:
“Whether” usually doesn’t introduce a conditional clause. Instead, it introduces an indirect question, for example:
[What I don't know is: Does he have an iPhone?]
Since this is not a conditional clause, there’s no reason to avoid the future tense when appropriate:
[I can't decide: Will I buy an iPhone or an Android phone?]
“If” is often used in the meaning of “whether”, especially in the spoken language. If you can replace “if” in the sentence by “whether”, what follows is not a conditional clause, so the future can be expressed using “will”:
However, there’s also a less common meaning of “whether” which does introduce a conditional clause. This is best demonstrated using an example:
The first clause is to be understood as
“Whether” used in this sense is always followed by “or not” (but seeing “or not” after whether doesn’t imply it was used in this sense).