With "ImageIO.write()" API call I get NullPointerException
With "ImageIO.write()" API call, I get NullPointerException when I pass a non-existent path like "\\abc\abc.png". I pass the non-existent path purposely to test something but instead of getting FileNotFoundException, I get NPE. Don't know why? ImageIO.write() API is suppose to throw IOException but don't why I get NPE.

I use exception message string to show it in a message box to user but in this case NPE.getLocalizedMessage() returns empty string and hence the popup is empty with jsut an icon on it.. 

Please help !!

Thanks,
Nayan
With "ImageIO.write()" API call I get NullPointerException
===

With "ImageIO.write()" API call, I get NullPointerException when I pass a non-existent path like "\\abc\abc.png". I pass the non-existent path purposely to test something but instead of getting FileNotFoundException, I get NPE. Don't know why? ImageIO.write() API is suppose to throw IOException but don't why I get NPE.

I use exception message string to show it in a message box to user but in this case NPE.getLocalizedMessage() returns empty string and hence the popup is empty with jsut an icon on it.. 

Please help !!

Thanks,
Nayan