Some of Williams Companies' assets. Image source: Williams Companies.

The oil and gas midstream space has been rocked by the ruling of a Texas bankruptcy court. What some once thought were ironclad contracts may, in fact, turn out to be a little more optional than that. That, in turn, could kill the distributions of companies such as Williams Companies (WMB -0.27%), Tallgrass Energy LP (NYSE: TEP), and Corenergy Infrastructure Trust (CORR). But, in the end, no pipeline owner is truly safe.

What's the back story?
While the U.S. oil and gas boom was building up steam, companies such as Ultra Petroleum (UPL), Energy XXI, and Goodrich Petroleum, among so many others, were drilling with abandon, their results buoyed by high oil prices. But drilling is only half the picture.

Indeed, just pulling oil and gas out of the ground does a company no good unless it can get its product to market. That's where midstream assets, such as pipelines, come into play. Pipelines transport the oil and gas pulled out of the ground from where it's drilled to where it gets used. So with the new drilling came new pipelines. Many of these pipelines are owned by limited partnerships such as Tallgrass Energy LP, which are designed to pass through income to investors in a tax-efficient manner and often sport relatively high yields. Investors snapped these LPs up. That said, not all midstream owners are LPs, some are traditional corporations, and Corenergy is structured as a real estate investment trust (REIT).

What's a contract worth?
In many cases, oil and gas drillers signed contracts with pipeline owners that required payment for a certain amount of transportation volume regardless of whether that volume gets transported. These are often called take-or-pay contracts. These contracts were expected to protect pipeline companies' revenues from the risk of commodity price fluctuations -- after all, pipeline customers had to pay no matter what, right?

WMB Chart

WMB data by YCharts

Well, enter a deep and prolonged energy downturn and things don't look quite the same as planned. Oil and gas drillers are pulling back hard on spending and some, including Ultra, Energy XXI, and Goodrich, are facing the real possibility of bankruptcy. And that, in turn, could affect the owners of the pipelines that handle the oil and gas of these troubled drillers.

The big news here came out of a Texas bankruptcy court overseeing the bankruptcy of Sabine Oil & Gas. The judge in the case recently ruled that the driller could reject pipeline contracts with a unit of Cheniere Energy (LNG 2.31%). In other words, a driller with a take or pay contract may be able to get out of that contract. This could turn into an important precedent and lead more financially challenged drillers to try to wiggle out of similar contractual agreements.

For example, Chesapeake Energy (CHKA.Q) is a driller trying to work out from under the debts incurred to acquire drilling land during the boom years, but low oil and gas prices are making that task increasingly difficult. One of its primary pipeline partners is Williams Companies, which sports a nearly 16% yield. Even if Chesapeake doesn't go belly up, it could use the Texas case as leverage to renegotiate its contracts with Williams. That, in turn, could make it harder, if not impossible, for Williams to support its high yield.

Spreading the pain
Ultra Petroleum, meanwhile, is a key customer on the Rocky Mountain Express pipeline system that is owned by Tallgrass Energy, which has an over 6.5% distribution yield. So Tallgrass, a publicly traded limited partnership, could feel some pain, too, if customers such as Ultra push back on contracts.

Corenergy's "core" as sets. Image Source: Corenergy

Meanwhile, Ultra is also a key customer of Corenergy. But so is struggling Energy XXI. Corenergy, however, is slightly different than Tallgrass or Williams because it's a REIT. So it doesn't have take or pay contracts, it has property leases. Although it's unclear how these property leases will hold up in a bankruptcy case, investors are clearly concerned -- Corenergy recently yielded nearly 20%. The real problem Corenergy faces is that Ultra and Energy XXI backstop roughly two-thirds of its business.

Now Corenergy and other pipeline owners will argue, and correctly so, that their pipes are integral to drillers' businesses. After all, without transportation oil and gas can't get to market. Any troubles, in the end, will likely be dealt with on a case by case basis. And while that may mean customers keep paying, it doesn't mean they'll keep paying what's being paid today.

If Williams, Tallgrass, or Corenergy suddenly see revenues drop because their contracts aren't as ironclad as thought, they could have a hard time continuing to pay the dividends and distributions they pay today. In other words, danger lurks for these three high-yield dividend stocks, and likely many more. If you own a pipeline company, you'll want to pay close attention to what's going on in Texas.