Replacement of undefined elements of a list

I have two lists of numbers, both have entries that are indefinite. I'm trying to use an If statement to replace any undefined item in a list by its corresponding number located at the same position in the second list.

Table[If[list2[[i]]=== Undefined, list4[[i]], list2[[i]]], {i, 1, length[list2]}]

However, this code seems to return list4. It's as if Mathematica did not recognize the existence of a digital element as being the lie of Undefined