if (parent.getChildCount() > 0) {
if (parent.getChildCount() > index) {
	public static void createLink(			final String linkType,			final MatrixTreeNode[] children,			MatrixTreeNode _parent,			int _index,			final int prevIndex,			final String[] parentIds) {		// Make sure ExpandingNode is not our parent		if (_parent instanceof ExpandingNode) {			if (_parent instanceof ExpandingNextNode) {				_index =  AssetManager.getLimit();			} else {				_index =  -1;			}			_parent = (MatrixTreeNode)_parent.getParent();		}		final int index = _index;		final MatrixTreeNode parent = _parent;		final String[] assetids = new String[] { parent.getAsset().getId() };		AssetRefreshWorker worker = new AssetRefreshWorker(assetids, true) {			public Object construct() {				try {					int newIndex = index;					if (!parent.getAsset().getId().equals("1")) {						int limit = AssetManager.getLimit();						// we need to change the index since we are not on the first set						if (index >= limit) {							// move the asset to the next set							int modifier = 0;							// check for previous node							if (parent.getAsset().getTotalKidsLoaded() == 0) {								modifier = 1;							}							newIndex = ((MatrixTreeNode)parent.getChildAt(limit-modifier)).getSortOrder() + children.length;						} else if ((index <= 0) && (parent.getAsset().getTotalKidsLoaded() > 0)) {							if (parent.getChildCount() > 0) {								// move the asset to previous set								newIndex = ((MatrixTreeNode)parent.getChildAt(1)).getSortOrder() - children.length;							}						} else if (index >= 0) {							if (parent.getChildCount() > 0) {								newIndex = ((MatrixTreeNode)parent.getChildAt(index)).getSortOrder();							}						}					}					Boolean refresh = doLinkRequest(						linkType,						children,						parent,						newIndex,						parentIds					);					if (refresh == Boolean.TRUE) {						String parentid = parent.getAsset().getId();						return AssetManager.makeRefreshRequest(assetids, "");					}				} catch (IOException ioe) {					return ioe;				}				return null;			}			public void finished() {				// if we need to refresh the parent, call super to do so				if (get() != null)					super.finished();				else					MatrixStatusBar.setStatusAndClear(Matrix.translate("asset_map_status_bar_success"), 1000);			}		};		worker.start();	}