[Geoserver-devel] [jira] Created: (GEOS-4127) GetLegendGraphic causes NullPointerException if any SLD rules are missing tags</span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=geoserver-devel@lists.sourceforge.net&q=from:%22Joshua+M.+Thompson+%5C%28JIRA%5C%29%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Joshua M. Thompson (JIRA)</span></span></a></span> <span class="date"><a href="/search?l=geoserver-devel@lists.sourceforge.net&q=date:20100908" rel="nofollow">Wed, 08 Sep 2010 09:08:39 -0700</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre>GetLegendGraphic causes NullPointerException if any SLD rules are missing <Title> tags --------------------------------------------------------------------------------------</pre><pre> Key: GEOS-4127 URL: <a rel="nofollow" href="http://jira.codehaus.org/browse/GEOS-4127">http://jira.codehaus.org/browse/GEOS-4127</a> Project: GeoServer Issue Type: Bug Components: WMS Affects Versions: 2.1-beta1 Environment: SuSE Enterprise 10, Sun Java 1.6.0_13, Tomcat 5.5.30 Reporter: Joshua M. Thompson Assignee: Andrea Aime When requesting the legend for a layer, if any of the SLD rules for that layer do not have titles GeoServer will throw a NullPointerException. Adding a non-empty title (even just a single space) fixes the crash, at the expense of having a rather ugly blank line in the legend output. The culprit seems to be in DefaultRasterLegendProducer.java around line 311: labels[i] = rule.getDescription().getTitle().toString(); if (labels[i] == null) labels[i] = rule.getName(); if (labels[i] == null) labels[i] = ""; If the title doesn't exist it will try to call toString() on a null pointer. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: <a rel="nofollow" href="http://jira.codehaus.org/secure/Administrators.jspa">http://jira.codehaus.org/secure/Administrators.jspa</a> - For more information on JIRA, see: <a rel="nofollow" href="http://www.atlassian.com/software/jira">http://www.atlassian.com/software/jira</a> ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. <a rel="nofollow" href="http://p.sf.net/sfu/intel-thread-sfd">http://p.sf.net/sfu/intel-thread-sfd</a> _______________________________________________ Geoserver-devel mailing list Geoserver-devel@lists.sourceforge.net <a rel="nofollow" href="https://lists.sourceforge.net/lists/listinfo/geoserver-devel">https://lists.sourceforge.net/lists/listinfo/geoserver-devel</a> </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg11011.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="index.html#11013">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="maillist.html#11013">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg11014.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> </ul> </div> <div class="overflow msgActions margintopdouble"> <div class="msgReply" > <h2> Reply via email to </h2> <form method="POST" action="/mailto.php"> <input type="hidden" name="subject" value="[Geoserver-devel] [jira] Created: (GEOS-4127) GetLegendGraphic causes NullPointerException if any SLD rules are missing <Title> tags"> <input type="hidden" name="msgid" value="25708667.54419.1283962052793.JavaMail.haus-jira@codehaus01.managed.contegix.com"> <input type="hidden" name="relpath" value="geoserver-devel@lists.sourceforge.net/msg11013.html"> <input type="submit" value=" Joshua M. Thompson (JIRA) "> </form> </div> </div> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="geoserver-devel@lists.sourceforge.net"> <label class="hidden" for="q">Search the site</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search geoserver-devel"> <input class="submitbutton" name="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"><a href="/geoserver-devel@lists.sourceforge.net/">geoserver-devel - all messages</a></li> <li class="icons-about"><a href="/geoserver-devel@lists.sourceforge.net/info.html">geoserver-devel - about the list</a></li> <li class="icons-expand"><a href="/search?l=geoserver-devel@lists.sourceforge.net&q=subject:%22%5C%5BGeoserver%5C-devel%5C%5D+%5C%5Bjira%5C%5D+Created%5C%3A+%5C%28GEOS%5C-4127%5C%29+GetLegendGraphic+causes+NullPointerException+if+any+SLD+rules+are+missing+%3CTitle%3E+tags%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg11011.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg11014.html" title="n">Next message</a></li> </ul> </div> <div class="listlogo margintopdouble"> </div> <div class="margintopdouble"> </div> </div> </div> <div class="footer" role="contentinfo"> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> <li class="darkgray">25708667.54419.1283962052793.JavaMail.haus-jira@codehaus01.managed.contegix.com</li> </ul> </div> </body> </html> <script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9a37be8699f0e25f',t:'MTc2Mzk3NTEyMg=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script>