-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Steve,
Steve R Burrus wrote: > hi chris this is steve Burrus and the line of code in question is the > while loop : "while( ( r = in.read(by)) != -1) {" the server error for a > long time has always pointed to that line of code creating the NPE. Yup, that's the first time you use the InputStream after attempting to load your file. It's pretty simple to check for null: just use the code I suggested in my last message: >> Correct me if I'm wrong, but this generally checks for null: >> >> if(null == in) >> // handle the null condition Now, it's up to you what you want to do in the event of a NULL image. You could either return a "404 Not Found" error status, or return a known good image that actually says "ERROR" on it. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFWM4Y9CaO5/Lv0PARArEgAKC8p+909qemHgpbGFmO5Fooh8AWcACeLF29 ajQlvN1B+YLbdmoKa+TFoyM= =G5GE -----END PGP SIGNATURE----- --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]