I have a branding solution consisting of one feature to deploy a custom master to the site collection. A web scoped feature exists in a separate solution that when activated sets the custom master as the MasterUrl and CustomMasterUrl. I have separated this into its own solution as we have several branding packages, each having a master that shares the same name.
The problem I have is that if the master page does not exist when the web scoped feature is activated, the whole site blows up (understandably).
What I want is to verify that this custom master page exists. So far I've tried setting up an HTTP Request / Response and verify that the response is OK before setting the master URL, but it hasn't worked. I'm starting to wish I just dealt with having redundant code by having this web scoped feature as a part of each branding package - at least then I can set up a feature activation dependency.
So how can I verify that the master page exists in the expected location before I apply it?