Depositing money in riba-based banks out of necessity, in order to protect the money
Question

                I read some of your answers about riba, and I found a contradiction that left me confused about my situation. You said to the one who wants to rent out a building to a riba-based bank that this is definitively haraam, but you said to one who deposits his money in a riba-based bank for fear that he may lose it that this is permissible, although the latter will come under the heading of one who pays riba and of cooperating in sin and transgression. I hope that you can explain it to me, as I put my money in a riba-based bank because there are no Islamic banks in my country and I am not sure whether this money is halaal or haraam.
Praise be to Allah.Firstly: 
Renting out 
    a store or house to one who will use it for sinful purposes is not 
    permissible; that includes renting out a building to a riba-based bank, 
    because that is clearly helping in sin and transgression, because the owner 
    of the building knows that the bank is renting this place in order to engage 
    in haraam transactions such as riba etc. 
Al-Bayhaqi 
    said in Sharh Muntaha al-Iraadaat (2/358): it is not valid to rent 
    out a house to be used as a church, synagogue or monastery, or for the sale 
    of alcohol or for gambling etc., whether that is stipulated in the contract 
    or is known by other means, because it is a haraam action and it is not 
    permissible to rent it out for that purpose. End quote. 
Secondly: 
Depositing 
    money in a riba-based bank is haraam, whether one earns interest or not, 
    because the bank will take the money and lend it in return for interest. 
But the 
    scholars made an exception in one case, which is when a person fears for his 
    wealth and there is no safe place to protect his money. In that case it is 
    permissible for him to put it in a riba-based bank, based on the principle 
    that in cases of necessity, forbidden things become permissible. In that 
    case he must put it in a current account that does not bear interest, 
    because in cases of necessity, things are only permitted as much as is 
    needed; he needs to protect his money, but he does not need to deal in 
    riba. 
For 
    information on the conditions of putting money in riba-based banks, please 
    see question no. 22392.
And Allaah 
    knows best.