             if @codemirror.getSelection() isnt ''
                 @hide_suggestion_and_description()
                 # We still want to catch ctrl + v
-                if event.ctrlKey and event.which is 86 and event.type is 'keydown' # Ctrl + V
+                if event? and event.ctrlKey is true and event.which is 86 and event.type is 'keydown' # Ctrl + V
                     @last_action_is_paste = true
                     @num_released_keys = 0 # We want to know when the user release Ctrl AND V
                     @hide_suggestion_and_description()

                        suggestion: suggestion
                @show_suggestion()
                @hide_description()
            else if result.description?
                @hide_suggestion()
                @show_description result.description
            else


            # We just look at key up so we don't fire the call 3 times
            # TODO Make it flawless. I'm not sure that's the desired behavior
            if event?.type? and (event.type isnt 'keyup' and event.type isnt 'mouseup') or (event?.which? and event.which is 16) # We don't do anything for shift
                return false

            @current_highlighted_suggestion = -1
