qzind / qz-print

Archive for legacy qz-print versions (1.8, 1.9). See https://github.com/qzind/tray for modern versions.
Other
141 stars 101 forks source link

qz.findPrinter() not working #96

Closed tresf closed 9 years ago

tresf commented 9 years ago

In 1.8 (applet), qz.findPrinter() was a completely valid command. Now with 1.9, it is not.

The exact error message is:

Sep 1, 2015 12:00:00 AM qz.PrintApplet run
INFO: ===== JAVASCRIPT LISTENER THREAD STOPPED =====
Exception in thread "Thread-16" java.lang.NullPointerException
    at qz.PrintApplet.startJavaScriptListener(Unknown Source)
    at qz.PrintApplet.access$000(Unknown Source)
    at qz.PrintApplet$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at qz.PrintApplet.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
cache: Clean up the reference queue: file:/Users/foo/bar/qz-print.jar
tresf commented 9 years ago

Partially caused with the introduction of #86, as dummy printer logic was doing string comparison against null causing NPE. Closed via bbf0263, checks for null prior to comparing string.

image