1

Resolved

Crash when no notifications are configured

description

I don't have any notifications configured
 
Error
Application: CloudInit.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
at CloudInit.Notification.Core.NotificationProviderBase.GetSetting[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]
at CloudInit.CIService.Main(System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

comments

bwight4157 wrote Jan 30, 2012 at 8:39 PM

Nice catch, i've always used the notifications so i didn't see this. I will update it tomorrow as I don't have time to do it right now. Just change the code in NotificationProvider base to catch the exception.
    public Boolean IsActive
    {
        get
        {
            try
            {
                return GetSetting<Boolean>("IsActive");
            }
            catch (Exception ex)
            {
                return false;
            }
        }
    }

wrote Jan 30, 2012 at 8:41 PM

bwight4157 wrote Jan 30, 2012 at 8:42 PM

I've updated source code but haven't fixed it in the release yet.

bwight4157 wrote Jan 31, 2012 at 1:38 PM

Fixed this in the release now.

wrote Jan 31, 2012 at 1:38 PM

bwight4157 wrote Jan 31, 2012 at 1:38 PM

** Closed by bwight4157 1/31/2012 6:38 AM

bwight4157 wrote Jan 31, 2012 at 1:38 PM

wrote Jan 31, 2012 at 1:38 PM

wrote Feb 13, 2013 at 9:37 PM

wrote May 16, 2013 at 1:29 AM

wrote May 16, 2013 at 1:29 AM

wrote Jun 14, 2013 at 7:11 AM