Community
Participate
Working Groups
Build Identifier: I20110310-1119 WorkspaceFileHyperlink throws Null Pointer Exception for tag attribute values contains path to image file, like this: <h:graphicImage value="/img/error.gif" alt="Seam logo"/> Reproducible: Always Steps to Reproduce: 1. Create Dynamic Web Project 2. Put home.xhtml to WebContent folder and put error.gif to WebContent/img folder 3. Open home.xhtml file in Web Page Editor 4. Point mouse on "/img/error.gif" tag attribute value and press Ctrl button FAIL: NullPointerException
Created attachment 195388 [details] Stack Trace log
Created attachment 195389 [details] XHTML page
Created attachment 195390 [details] GIF image
Fixed. Thanks for the report and the helpful testcase.
Created attachment 195405 [details] patch
Jumped the gun. Need PMC approval. * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. If someone tries to hyperlink on an attribute that references a file in the workspace that does not have a content describer, you'll get an NPE. The example given is a reference to a GIF in the workspace. * Is there a work-around? If so, why do you believe the work-around is insufficient? No * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? Ad hoc testing. * Give a brief technical overview. Who has reviewed this fix? Because some workspace files do not have a content describer (the attached image is a good example), we must check that one exists before trying to use it to find a default editor. * What is the risk associated with this fix? None. It's a null pointer check.
Thanks for the review.