<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>KB-1341 Using a nested split() throws a NullPointerException</title><link>https://community.appian.com/support/w/kb/574/kb-1341-using-a-nested-split-throws-a-nullpointerexception</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>KB-1341 Using a nested split() throws a NullPointerException</title><link>https://community.appian.com/support/w/kb/574/kb-1341-using-a-nested-split-throws-a-nullpointerexception</link><pubDate>Thu, 11 May 2017 17:33:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:475c4347-9155-49f8-8368-ea2674cebb82</guid><dc:creator>Nick Vigilante</dc:creator><comments>https://community.appian.com/support/w/kb/574/kb-1341-using-a-nested-split-throws-a-nullpointerexception#comments</comments><description>Current Revision posted to Appian Knowledge Base by Nick Vigilante on 5/11/2017 5:33:08 PM&lt;br /&gt;
&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When using split() with a delimiter in the first position, the expression throws a Null Pointer Exception.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For example, the following expression:&lt;/p&gt;
&lt;pre class="code-java"&gt;split(split(&lt;span class="code-quote"&gt;&amp;quot;accbcc&amp;quot;&lt;/span&gt;, &lt;span class="code-quote"&gt;&amp;quot;a&amp;quot;&lt;/span&gt;), &lt;span class="code-quote"&gt;&amp;quot;b&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;p&gt;is not valid because the inner &amp;#39;split()&amp;#39; returns a list of two texts, the first empty (null) and the second with characters&lt;/p&gt;
&lt;p&gt;However, the following will not throw a null pointer exception:&lt;/p&gt;
&lt;pre class="code-java"&gt;split({&lt;span class="code-keyword"&gt;null&lt;/span&gt;, &lt;span class="code-quote"&gt;&amp;quot;accbcc&amp;quot;&lt;/span&gt;}, &lt;span class="code-quote"&gt;&amp;quot;b&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This issue has been reported to the Appian product team. The reference number for this issue is &lt;strong&gt;AN-57629&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Workaround&lt;/h2&gt;
&lt;p&gt;Avoid using nested splits with a leading delimiter.&lt;/p&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: April 2017&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: known issues, expression rules, application design, open issues&lt;/div&gt;
</description></item></channel></rss>