     if classname is TASK
       listId = model.list
       @taskAdd id, listId
+
+    # Make sure model.tasks exists
     else if classname is LIST
-      model.tasks = []
+      model.tasks ?= []
 
     # Add item to server
     @user.setModel(classname, id, model)

  # Create a new model
  create: (classname, model, timestamp) =>

    # Generate new id
    if classname is PREF
      id = 1
      model = @settingsValidate(model)

    else if classname is LIST and model.id is INBOX
      id = model.id
      if @hasModel(LIST, INBOX) then return

    else
      id = model.id = @createId classname


    @time = new Time(@user)

  createId: (classname) ->
    id = @user.incrIndex classname
    return SERVER_ID + (id - 1)

  #####################################
  #    __   __   ___      ___  ___    #
