#1645 Added nil check to settings when adding flags to build files

This fixes an issue when doing a `pod install` which causes a `undefined method '[]' for nil:NilClass` due to the post install hook not checking for nil on the settings object.