{
tab = getTabTemplateByGadgetId(gadgetToDelete.getId(), false);
}
catch (Exception ex)
{
throw new GadgetDeletionException("Could not find either the specified Gadget or Tab", gadgetToDelete
.getId());
}
// remove the gadget from the collection
if (tab.getGadgets().size() > 1)