The official website for The Settlers of Catan

Question about “Cities & Knights” Expansion City Walls - Does a city wall protect commodities from the robber?

Answer

Yes. The robber does not distinguish between commodities and resources; for him, they are only “cards from some player’s hands.”