Avoid a NullReferenceException if no configuration file is present for DbMetal.
-- Emanuele Aina Studio Associato Di Nunzio e Di Gregorio http://dndg.it/ Via Maria Vittoria, 2 10123 Torino - Italy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DbLinq" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dblinq?hl=en -~----------~----~----~----~------~----~------~--~---
>From c90712ea39a23c01041b21f2e04a34c5656d110e Mon Sep 17 00:00:00 2001 From: Emanuele Aina <[email protected]> Date: Thu, 3 Sep 2009 23:11:07 +0200 Subject: [PATCH 4/7] Make DbMetal fail a little more gracefully if no config is present --- .../Implementation/SchemaLoaderFactory.cs | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/DbMetal/Generator/Implementation/SchemaLoaderFactory.cs b/src/DbMetal/Generator/Implementation/SchemaLoaderFactory.cs index e3c1666..6c7ba8b 100644 --- a/src/DbMetal/Generator/Implementation/SchemaLoaderFactory.cs +++ b/src/DbMetal/Generator/Implementation/SchemaLoaderFactory.cs @@ -234,7 +234,7 @@ namespace DbMetal.Generator.Implementation ProvidersSection.ProviderElement element; string errorMsg; - if (!configuration.Providers.TryGetProvider(provider, out element, out errorMsg)) + if (configuration == null || !configuration.Providers.TryGetProvider(provider, out element, out errorMsg)) { Output.WriteErrorLine(Log, "Failed to load provider {0} : {1}", provider, errorMsg); throw new ApplicationException("Failed to load provider " + provider); -- 1.6.3.3
