Two long-standing European airlines, Spanair and Malev, suddenly ceased operations last week, leaving thousands of travelers in the lurch. Star Alliance member Spanair cancelled 220 flights and stranded over 22,000 customers when it abruptly grounded its fleet in late January.

To make matters worse, the Spanish airline is accused of not providing flight alternatives or returning luggage to passengers who checked in right before the shut down. On Friday, Hungary’s national carrier and oneworld member Malev grounded all flights, leaving 7,200 passengers scrambling to find new travel arrangements.

Although it’s a situation you never want to be in - especially in a foreign country - here are some tips to get you back in the air quickly if your airline goes bust.

Do your homework.  Before you book your flight, do some Googling to find any rumblings of trouble with the airline. For example, searching “Malev” in Google News foretold financial woes in early January.  Other events that suggest an airline is unstable: drastic route changes or cuts, senior management shakeups and widespread layoffs. Don’t count on the airline to keep you informed - Malev folded on a Friday but was still selling tickets on Thursday.

Harness the power of a travel department or agency. If you have a corporate travel department or booked through a travel agency, you’ll have a team of people helping you get a new flight and a ticket refund. If you booked independently, make sure to use a credit card for faster reimbursement.

Use technology for the upper hand. Chances are the now-defunct airline isn’t answering the phone and won’t be much help in rebooking. Instead, travel with a smartphone, tablet, or laptop so you can quickly jump online and check the airline’s website for who to contact (for example, Spanair’s site lists Vueling, Iberia and Air Europa as possible alternatives), find out which other airlines are flying the route, and book a new flight online if the wait times to speak with customer service via phone are ridiculous.

Although travel insurance is useful in many cases, you might be surprised to find airline shutdown isn’t covered. A scan of various plan levels on travel insurance comparison site Squaremouth revealed that only 41 out of 106 offered “financial default” coverage, and those were the most expensive options.

Even if the benefit is offered in your plan, check that your airline is on the covered supplier list - many insurance companies list airlines as exempt from coverage in case of bankruptcy or ceased operations.