       return free
 
     $scope.createVdi = (name, size, sr, bootable, readonly) ->
+      return unless checkMainObject
 
       $scope.createVdiWaiting = true # disables form fields
       position = $scope.maxPos + 1

      if not vdi?
        return
      for vbd in vdi.$VBDs
        rVbd = vbd if (get vbd).VM is $scope.VM.id
      return rVbd || null

    $scope.disconnectVBD = (vdi) ->

      $scope.newInterfaceMTU = network && network.MTU

    $scope.createInterface = (network, mtu, automac, mac) ->
      return unless checkMainObject()

      $scope.createVifWaiting = true # disables form fields

