This is actually an error in Java's printing framework that has been introduced with Java 9: JDK-8221411 : NullPointerException in RasterPrinterJob without PrinterResolution.
Other users of yEd have been able to workaround this problem by running yEd on Java 8 instead of Java 9/10/11/12. Thus if you do not need Windows display scaling, the yEd installer with embedded Java 8 runtime environment might be an option for you. Said Java 8 installer is available from the yEd download page.
Another option would be printing to a PDF printer or exporting your diagram to a PDF or SVG file and use a PDF/SVG viewer application for printing.