#vulnerable code 
                             private void serverTreeItemSelected(TreeItem selectedItem, boolean refresh) {
		this.itemSelected = selectedItem;
		tree.setSelection(selectedItem);
		text.setText(selectedItem.getText() + ":");
		table.removeAll();

		serverItemSelected();

		if (refresh)
			selectedItem.setData(ITEM_OPENED, false);

		if (selectedItem.getData(ITEM_OPENED) == null
				|| ((Boolean) (selectedItem.getData(ITEM_OPENED)) == false)) {
			selectedItem.removeAll();
			addDBTreeItem((Integer) selectedItem.getData(NODE_ID), selectedItem);
		}

		int dbs = service1.listDBs((Integer) selectedItem.getData(NODE_ID));
		for (int i = 0; i < dbs; i++) {
			TableItem item = new TableItem(table, SWT.NONE);
			item.setText(new String[] { DB_PREFIX + i,
					NodeType.DATABASE.toString() });
			item.setData(NODE_ID, i);
			item.setImage(dbImage);
			item.setData(NODE_ID, i);
			item.setData(NODE_TYPE, NodeType.DATABASE);
		}

	} 
                            #location 15 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             private void serverTreeItemSelected(TreeItem selectedItem, boolean refresh) {
		this.itemSelected = selectedItem;
		tree.setSelection(selectedItem);
		text.setText(selectedItem.getText() + ":");
		table.removeAll();

		serverItemSelected();

		int amount = service1.listDBs((Integer) selectedItem.getData(NODE_ID));
		
		if (selectedItem.getData(ITEM_OPENED) == null
				|| ((Boolean) (selectedItem.getData(ITEM_OPENED)) == false)) {
			selectedItem.removeAll();
			
			for (int i = 0; i < amount; i++) {
				TreeItem dbItem = new TreeItem(selectedItem, SWT.NONE);
				dbItem.setText(DB_PREFIX + i);
				dbItem.setData(NODE_ID, i);
				dbItem.setData(NODE_TYPE, NodeType.DATABASE);
				dbItem.setImage(dbImage);
			}
			selectedItem.setExpanded(true);
			selectedItem.setData(ITEM_OPENED, true);
		} else if (refresh){
			
		}

		for (int i = 0; i < amount; i++) {
			TableItem item = new TableItem(table, SWT.NONE);
			item.setText(new String[] { DB_PREFIX + i,
					NodeType.DATABASE.toString() });
			item.setData(NODE_ID, i);
			item.setImage(dbImage);
			item.setData(NODE_ID, i);
			item.setData(NODE_TYPE, NodeType.DATABASE);
		}

	}