Michael Lynton revealed professional and personal lessons learned from the devastating 2014 hack by North Korea on Sony Pictures Entertainment — admitting that he thought there was a “better than even chance” that the studio was not going to make it through the crisis.

“It was really one of those instances where the company would have either fallen off a cliff and not survived or, as we managed to do, survive and pull it through with collective action,” said Lynton, speaking at the Lerer Hippeau Ventures CEO Summit on Tuesday in New York.

Lynton’s remarks come as Hollywood has again become a high-profile target of cybercriminals. Hackers stole an unreleased Disney movie and are threatening to leak it unless the studio pays a ransom, echoing the theft of episodes of Netflix’s “Orange Is the New Black” season five last month.

In the Sony incident, hackers employed by the North Korean regime in November 2014 took down the majority of Sony’s computer infrastructure, and stole and released internal company emails and unreleased movies. The government was retaliating for the studio’s comedy film “The Interview,” which involves the assassination of the country’s dictator by two TV journalists (James Franco and Seth Rogen) who are undercover spies.

Lynton, who is now chairman of Snapchat’s parent company Snap, shared several points about steering Sony Pictures through the storm as CEO.

First, he said, “You have to be ridiculously optimistic. You have to say to everyone around you, ‘We’re going to get through this,’ because most employees will not expect that to happen.”

As chief executive of a company in the throes of a disaster, he said, “Your only job is to manage the crisis until you’re through it. You cannot, under any circumstances, give away any authority – everything has to come back to your desk.”

Lynton was caught off guard by the crippling cyberattack because the officials and experts whom Sony had consulted following the North Korean government’s threats against the studio in June 2014 had said there wasn’t any danger, according to the exec. “We asked, ‘What could they do? The answer was ‘Nothing… You needn’t worry about that.’”

Lynton again reiterated his personal opinion that “the media behaved very irresponsibly,” by publishing the hacked emails. “These were private correspondences that were stolen by the North Korean government,” he said. The press coverage affected the studio’s standing with the public along with the actors, actresses, producers and others who were exposed as well, he said.

Earlier this year Lynton stepped down as chairman and CEO of Sony Pictures Entertainment to focus on his role as chairman of Snap, the parent company of Snapchat. Snap’s stock soared in its IPO earlier this year, then crashed last week after the company missed first-quarter earnings. Shares have regained those losses this week after hedge-fund investors disclosed large positions in Snap.

Just as Google said in its early days that it wanted to own the search bar, “Snap would like to do the same with the camera: When you open Snap, you’re in the camera. That gives you a big field to play on,” said Lynton, an early angel investor in the company.

Asked if he was concerned about Snap’s ability to stay ahead of Facebook — which has shamelessly copied many Snapchat features in its own products — Lynton said he had confidence that CEO Evan Spiegel and his team will continue to innovate.

“We’re not even in the middle of it – we’re in maybe Chapter 1 of a 100-chapter book,” Lynton said of Snap.

Back to the Sony hack, Lynton said the biggest fallout from the breach (after the immediate triage mode of restoring communications and information-technology systems) was that employees’ emails were made public. That included embarrassing scuttlebutt about their coworkers — and the hackers also released employees’ salary info, Social Security numbers and other private data. “That took a long time to deal with,” he said.

The lesson there, which Lynton said he has imparted to Spiegel and Snap’s management team, is that you should not put any information you wouldn’t want made public on an internet-connected system.

From an emotional standpoint, Lynton said, his biggest realization was that he could not afford to get angry. “You have to put your temper to one side,” he said. “I took tremendous comfort from the people I worked with.”

Lynton, who was interviewed by LVH managing partner Ken Lerer, marveled that business leaders aren’t well prepared for dealing with a large-scale crisis. “When you start a business or go to business school, they talk about how to grow a business, but they never talk about when things go violently wrong,” he said.