Repository: missionpinball/mpf-mc
Issue: Crash in Widget Player

```
2016-09-24 17:49:06,398 : DEBUG : Events : ^^^^ Processing event 'slide_showattractdisplay_slide_10_created'. Type: None, Callback: None, Args: {}
2016-09-24 17:49:06,398 : DEBUG : Events : ['<bound', 'method', 'McWidgetPlayer._add_widget_to_slide_when_active', 'of', 'McConfigPlayer.widgets>'] (priority: 1) responding to event 'slide_showattractdisplay_slide_10_created' with args {'slide_name': 'showAttractDisplay_slide_10', 'play_kwargs': {'show_tokens': {}}, 'widget': 'widgetfortunefavors', 's': {'widget_settings': {'expire': '4s'}, 'key': '_global-widgetfortunefavors'}}
2016-09-24 17:49:06,399 : INFO : kivy : Base: Leaving application in progress...
2016-09-24 17:49:06,399 : ERROR : kivy : 'showAttractDisplay_slide_10'
Traceback (most recent call last):
  File "/Applications/MPF.app/Contents/Frameworks/python/3.5.0/lib/python3.5/site-packages/mpfmc/commands/mc.py", line 153, in __init__
    thread_stopper=thread_stopper).run()
  File "/Applications/MPF.app/Contents/Resources/kivy/kivy/app.py", line 828, in run
    runTouchApp()
  File "/Applications/MPF.app/Contents/Resources/kivy/kivy/base.py", line 487, in runTouchApp
    EventLoop.window.mainloop()
  File "/Applications/MPF.app/Contents/Resources/kivy/kivy/core/window/window_sdl2.py", line 619, in mainloop
    self._mainloop()
  File "/Applications/MPF.app/Contents/Resources/kivy/kivy/core/window/window_sdl2.py", line 362, in _mainloop
    EventLoop.idle()
  File "/Applications/MPF.app/Contents/Resources/kivy/kivy/base.py", line 327, in idle
    Clock.tick()
  File "/Applications/MPF.app/Contents/Resources/kivy/kivy/clock.py", line 515, in tick
    self._process_events()
  File "/Applications/MPF.app/Contents/Resources/kivy/kivy/clock.py", line 647, in _process_events
    event.tick(self._last_tick, remove)
  File "/Applications/MPF.app/Contents/Resources/kivy/kivy/clock.py", line 406, in tick
    ret = callback(self._dt)
  File "/Applications/MPF.app/Contents/Frameworks/python/3.5.0/lib/python3.5/site-packages/mpfmc/core/mc.py", line 391, in tick
    self.events.process_event_queue()
  File "/Applications/MPF.app/Contents/Frameworks/python/3.5.0/lib/python3.5/site-packages/mpf/core/events.py", line 502, in process_event_queue
    **event[3])
  File "/Applications/MPF.app/Contents/Frameworks/python/3.5.0/lib/python3.5/site-packages/mpf/core/events.py", line 438, in _process_event
    result = handler.callback(**merged_kwargs)
  File "/Applications/MPF.app/Contents/Frameworks/python/3.5.0/lib/python3.5/site-packages/mpfmc/config_players/widget_player.py", line 158, in _add_widget_to_slide_when_active
    slide = self.machine.active_slides[slide_name]
KeyError: 'showAttractDisplay_slide_10'
```

config:

```
- time: '+8'
  slides:
    showAttractDisplay_slide_10:
      widgets:    
      - type: video
        video: DMD_Fortune
        z: 200
        control_events: 
          - event: pre_show_slide
            action: seek 
            value: 0.0
          - event: pre_show_slide
            action: play
```

From: https://groups.google.com/forum/#!topic/mpf-users/yGf6YS1ID2I


Changed files:
mpfmc/config_players/widget_player.py

diff --git a/mpfmc/config_players/widget_player.py b/mpfmc/config_players/widget_player.py
index cf874d5..d7c2732 100644
--- a/mpfmc/config_players/widget_player.py
+++ b/mpfmc/config_players/widget_player.py
@@ -168,8 +168,9 @@ class McWidgetPlayer(McConfigPlayer):
 
     def _add_widget_to_slide_when_active(self, slide_name, widget, s, play_kwargs, **kwargs):
         del kwargs
-        slide = self.machine.active_slides[slide_name]
-        slide.add_widgets_from_library(name=widget, play_kwargs=play_kwargs, **s)
+        if slide_name in self.machine.active_slides:
+            slide = self.machine.active_slides[slide_name]
+            slide.add_widgets_from_library(name=widget, play_kwargs=play_kwargs, **s)
 
     def get_express_config(self, value):
         """Parse express config."""