Warren Buffett’s Berkshire Hathaway Sold Stock Before Fox Fired Bill O’Reilly

Warren Buffett has recently defended several of the controversial stocks he owns, including Wells Fargo and United Airlines. But there’s one scandal-ridden company he is no longer standing by: Fox.

Buffett’s company Berkshire Hathaway (BRK-A) gave up on Twenty-First Century Fox stock earlier this year, it disclosed Monday—just as the owner of Fox News was embroiled in a widening sexual harassment scandal that culminated last month in the ouster of political commentator Bill O’Reilly.

Berkshire Hathaway sold all of its nearly 9 million shares of Twenty-First Century Fox (FOXA) during the first quarter of 2017, a stake that would have been worth about $290 million at the end of March.

That decision turned out to be well timed: Since news broke on April 1 that the host of The O’Reilly Factor had been accused of harassment by multiple women, Fox stock has plunged more than 14%. The selloff would have cost Berkshire Hathaway nearly $42 million in value on its position.

It’s unclear whether Buffett, who is nicknamed the Oracle of Omaha, was bothered by the scandals surrounding Fox before he sold the stock. Berkshire Hathaway did not return a request for comment on whether the harassment claims played a part in his motivations for dumping the shares.

It’s likely, however, that Buffett would have disagreed with Fox’s efforts to reportedly sweep the allegations under the rug, silencing women who leveled accusations against O’Reilly as well as former Fox chairman Roger Ailes with settlement payments that ran in the millions of dollars. At the Berkshire Hathaway annual shareholder meeting earlier this month, Buffett commented on the fault he saw at Wells Fargo (WFC), where a high-pressure sales culture has been blamed for creating an atmosphere that led employees to create as many as 2 million fake accounts for customers.

For more on Warren Buffett, watch Fortune’s video:

“The main problem was that they didn’t act when they learned about it,” Buffett said at the meeting. “At some point if there’s a major problem, the CEO will get wind of it. And at that moment, that’s the key to everything, because the CEO has to act.” If Wells Fargo was simply ignoring repeated employee complaints or not making them a priority, “It was a huge, huge, huge error,” Buffett said.

Overall, Fox had been a rather unsuccessful investment for Buffett, whose stock-picking prowess has otherwise led to gains of more than $16 billion for Berkshire Hathaway over the past year. Since Buffett bought Fox stock at the end of 2014, the shares had largely gone nowhere after a few ups and downs; depending on when the investor sold, the best he could have done was roughly break even on his investment.

On the other hand, Buffett’s position in Apple (AAPL), has made him more than $3 billion this year alone. Berkshire Hathaway more than doubled its holding of Apple stock in the first quarter, the new filings show, for a total stake that’s now worth more than $20 billion.

Subscribe to the CFO Daily newsletter to keep up with the trends, issues, and executives shaping corporate finance. Sign up for free.