A London-based production company owned by Disney has pleaded guilty to two health and safety violations on the set of Star Wars: The Force Awakens which led to actor Harrison Ford breaking his leg. Ford suffered a broken leg on the film’s set in a June 2014 accident and prosecutors said the actor could have died during the accident.

Harrison FordHarrison Ford could have died during an accident on the set of The Force Awakens, a court has heard.

Foodles Production admitted two of four criminal charges at Milton Keynes Magistrates' Court on Tuesday, July 26th. Sentencing will take place on August 22nd. Ford had been filming a scene walking through the Millennium Falcon spaceship, when a hydraulic door knocked him to the ground and pinned him to the floor.

More: Harrison Ford Will Return As Indiana Jones For Fifth Movie In 2019

Ford suffered a broken leg, but prosecutor Andrew Marshall said the incident could have been much worse. Marshall said Ford has begun to walk back through the door after he hit a button, believing the set was not live and the door would not close.

But the door was being remotely operated by another person on set, and as Ford passed underneath it he was hit in the pelvic area and pinned to the ground. “It could have killed somebody. The fact that it didn’t was because an emergency stop was activated,” Marshall told the court.

Welcoming Foodles guilty plea, Britain’s Health and Safety Executive said in a statement: “This was a foreseeable incident. Foodles Production Ltd. has accepted it failed to protect actors and staff. The British film industry has a world-renowned reputation for making exceptional films.”

More: 'Star Wars' Company Face Court Over Harrison Ford's Set Injury

“Managing on-set risks in a sensible and proportionate way for all actors and staff – regardless of their celebrity status – is vital to protecting both on-screen and off-screen talent, as well as protecting the reputation of the industry.”