dtinteractive/Topshelf.Integrations — pull request #8 by acharcourts (2014-04-23 22:38:19+00:00)
Title: Fix Null Reference Exception on stopping Quartz

When other code uses a `BeforeStartingService`
but cancels service start, this extensions
`BeforeStoppingService` is called without the
`BeforeStartingService` ever being called. In this
situation, `Scheduler` is null, and calling
`Scheduler.Shutdown()` causes a Null Reference Exception.

```c#
// Other TopShelf startup code.
s.BeforeStartingService(hsc =>
{
if (CanStartPreconditionsMet())
{
return;
}

Log.Fatal("Some message.");

hsc.CancelStart();
});
```