It's a trickier process than you might think. Dead people's eyes usually have to be held open by retractors, so the researchers had to crop out everything but the iris to avoid obvious cues. The algorithm makers also took care to snap live photos using the same camera that was used for the cadaver database, reducing the chances of technical differences spoiling the results. There's a catch to the current approach: it can only spot dead eyes when the person has been deceased for 16 hours or more, as the differences in irises aren't pronounced enough in the first few hours. A crook could theoretically kill someone, prop their eyes open soon afterward and unlock their phone. However, this would limit the amount of time they could use this method. You may not want to make too many enemies, in other words -- just take comfort in knowing that your data could one day be secure against grave robbers.
Polish researchers have developed a machine-learning algorithm that can spot the difference between the iris of a living person and a cadaver, preventing criminals from using a dead person's eyes to unlock devices. The team used the same camera to take photos of each, and deleted all of the image except the iris and pupil. The algorithm scored a 99% accuracy rate. However, the system could only identify the irises of bodies which had been dead for the first few hours or longer.