         unless parsed.protocol in ['http:', 'https:'] and parsed.hostname
             err = new Error "Your URL looks invalid: #{cozyUrl}"
             log.warn err
-            callback? err
+            callback err
             return
         deviceName ?= os.hostname() or 'desktop'
         @askPassword (err, password, next) ->

async    = require 'async'
fs       = require 'fs'
os       = require 'os'
path     = require 'path-extra'
readdirp = require 'readdirp'
url      = require 'url'
filterSDK = require('cozy-device-sdk').filteredReplication
log      = require('printit')
    prefix: 'Cozy Desktop  '
    date: true


                deviceName: deviceName
                password: password
            Devices.registerDeviceSafe options, (err, credentials) ->
                return callback err if err
                config = file: true
                setDesignDoc = filterSDK.setDesignDoc.bind filterSDK
                setDesignDoc cozyUrl, deviceName, password, config, (err) ->
                    callback err, credentials


    # Save the config with all the informations for synchonization
