Some major retailers are hanging by a thread in trying to stave off bankruptcy filings. Some , like Toys R Us , have already filed and are trying to reorganize. And in the worst cases in the past year, some chains have moved directly to liquidate their businesses and close the doors.

The bigger issue is whether a gift card will become worthless if it involves a retailer that filed for bankruptcy protection. The retail industry saw a rash of bankruptcy filings as it lost sales to online retailers this past year — and that could only get worse in 2018.

This year, however, givers have more to worry about than whether the gift card will get shoved in the back of a drawer.

For a generation, gift cards have been the holiday present of last resort — the thing to buy when nothing comes to mind.

Each case has its own set of risks when it comes to gift cards.

"Gift cards are, technically, unsecured debt of the bankrupt retailer and bankruptcy law gives them no special protection," said Melissa Jacoby, a law professor at the University of North Carolina at Chapel Hill, who teaches bankruptcy law.

That's the bad news. The good news is that retailers filing Chapter 11 reorganizations often ask the court to let them continue to honor gift cards, she said. The request is often granted.

It's important because it's hard for a business to continue if customers don't have assurances that gift cards will still be good for purchasing merchandise and that patrons can make returns.

"If they go into Chapter 11, they immediately seek court authorization to honor gift cards," said Chuck Tatelbaum, senior attorney with the Tripp Scott law firm in Ford Lauderdale, Fla. "If they don't, it will kill sales."

A good example is Toys R Us, which remains a toy-industry force this holiday season despite having filed for a Chapter 11 bankruptcy this year. It won court permission to honor gift cards.

Gift card redemption isn't always a sure bet.

The past couple of years have been particularly hard on sporting goods stores, some of which have shut down. Sports Authority, for instance, went belly up, liquidating merchandise in about 400 stores.

If a store liquidates, gift card holders become the same as other unsecured creditors, said Tatelbaum, a national bankruptcy expert.

There are other risks, too, of having gift cards of retailers involved in bankruptcy. The retailer may emerge from the process in better financial health, but with fewer stores.That makes the chain less convenient. Also, it may break relationships with key suppliers, and may not be as well stocked as in the past.

Read more from CNBC.com:

Gift card crime fueling opioid addiction across the US