He was playing The Joker. Even if he hadn't finished his scenes it wouldn't be the first time a movie had been completed despite one of the actors dying mid-production.