# Buggy code
def add_handler(self, handler, group=DEFAULT_GROUP):
    """Register a handler.

    TL;DR: Order and priority counts. 0 or 1 handlers per group will be used. End handling of
    update with :class:`telegram.ext.DispatcherHandlerStop`.

    A handler must be an instance of a subclass of :class:`telegram.ext.Handler`. All handlers
    are organized in groups with a numeric value. The default group is 0. All groups will be
    evaluated for handling an update, but only 0 or 1 handler per group will be used. If
    :class:`telegram.ext.DispatcherHandlerStop` is raised from one of the handlers, no further
    handlers (regardless of the group) will be called.

    The priority/order of handlers is determined as follows:

      * Priority of the group (lower group number == higher priority)
      * The first handler in a group which should handle an update (see
        :attr:`telegram.ext.Handler.check_update`) will be used. Other handlers from the
        group will not be used. The order in which handlers were added to the group defines the
        priority.

    Args:
        handler (:class:`telegram.ext.Handler`): A Handler instance.
        group (:obj:`int`, optional): The group identifier. Default is 0.

    """
    # Unfortunately due to circular imports this has to be here
    from .conversationhandler import ConversationHandler

    if not isinstance(handler, Handler):
        raise TypeError("handler is not an instance of {0}".format(Handler.__name__))
    if not isinstance(group, int):
        raise TypeError("group is not int")
    if isinstance(handler, ConversationHandler) and handler.persistent:
        if not self.persistence:
            raise ValueError(
                "Conversationhandler {} can not be persistent if dispatcher has no "
                "persistence".format(handler.name)
            )
        handler.conversations = self.persistence.get_conversations(handler.name)
        handler.persistence = self.persistence

    if group not in self.handlers:
        self.handlers[group] = list()
        self.groups.append(group)
        self.groups = sorted(self.groups)

    self.handlers[group].append(handler)


# Traceback (AttributeError)
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/dispatcher.py", line 372, in process_update
handler.handle_update(update, self, check, context)
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/conversationhandler.py", line 343, in handle_update
new_state = handler.handle_update(update, dispatcher, check_result, context)
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/conversationhandler.py", line 357, in handle_update
self.update_state(new_state, conversation_key)
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/conversationhandler.py", line 376, in update_state
self.persistence.update_conversation(self.name, key, new_state)
AttributeError: 'NoneType' object has no attribute 'update_conversation'

# Fixed code
def add_handler(self, handler, group=DEFAULT_GROUP):
    """Register a handler.

    TL;DR: Order and priority counts. 0 or 1 handlers per group will be used. End handling of
    update with :class:`telegram.ext.DispatcherHandlerStop`.

    A handler must be an instance of a subclass of :class:`telegram.ext.Handler`. All handlers
    are organized in groups with a numeric value. The default group is 0. All groups will be
    evaluated for handling an update, but only 0 or 1 handler per group will be used. If
    :class:`telegram.ext.DispatcherHandlerStop` is raised from one of the handlers, no further
    handlers (regardless of the group) will be called.

    The priority/order of handlers is determined as follows:

      * Priority of the group (lower group number == higher priority)
      * The first handler in a group which should handle an update (see
        :attr:`telegram.ext.Handler.check_update`) will be used. Other handlers from the
        group will not be used. The order in which handlers were added to the group defines the
        priority.

    Args:
        handler (:class:`telegram.ext.Handler`): A Handler instance.
        group (:obj:`int`, optional): The group identifier. Default is 0.

    """
    # Unfortunately due to circular imports this has to be here
    from .conversationhandler import ConversationHandler

    if not isinstance(handler, Handler):
        raise TypeError("handler is not an instance of {0}".format(Handler.__name__))
    if not isinstance(group, int):
        raise TypeError("group is not int")
    if isinstance(handler, ConversationHandler) and handler.persistent:
        if not self.persistence:
            raise ValueError(
                "Conversationhandler {} can not be persistent if dispatcher has no "
                "persistence".format(handler.name)
            )
        handler.persistence = self.persistence
        handler.conversations = self.persistence.get_conversations(handler.name)

    if group not in self.handlers:
        self.handlers[group] = list()
        self.groups.append(group)
        self.groups = sorted(self.groups)

    self.handlers[group].append(handler)