title: Segmentaton fault in testing length of std::wstring
body: <p>I just don't get it. I have a function to read stemmed strings from a List, check each string if it contains a punctuation marker to and build phrases in a loop of the single word images. When I check the string building/containing the phrase with <strong>s.length() > 0</strong> in the if-statement I get a seg fault. Here is the function:</p>
  
  <pre><code>std::wstring
  Phrase::userFriendlyTerms() {
      std::wstring s = L"";
  
      List&lt;Object&gt; *terms = getTerms();
  
      Iterator&lt;Object&gt; *i = terms-&gt;iterator();
      for (; i-&gt;hasNext();) {
          StemmedTerm *t = (StemmedTerm *) i-&gt;next();
          std::wstring image = t-&gt;getTerm();
  
          // --- gdb shows me a seg. fault with s.length()
          if (s.length() &gt; 0 &amp;&amp;
              !((image.compare(L",") == 0) || (image.compare(L"?" == 0))
                  || (image.compare(L"!") == 0)
                  || (image.compare(L";") == 0))) {
              s.append(L" ");
          }
          s.append(image);
      }   
      delete i;
  
      return s;
  }
  </code></pre>
  
  <p>Exact error message is:</p>
  
  <pre><code>Program received signal SIGSEGV, Segmentation fault.
  __wcslen (s=0x0) at wcslen.c:30
  30  wcslen.c: No such file or directory.
      in wcslen.c
  (gdb) run
  The program being debugged has been started already.
  Start it from the beginning? (y or n) n
  Program not restarted.
  (gdb) backtrace
  #0  __wcslen (s=0x0) at wcslen.c:30
  #1  0x00007ffff7b89e56 in std::basic_string&lt;wchar_t, std::char_traits&lt;wchar_t&gt;, std::allocator&lt;wchar_t&gt; &gt;::compare(wchar_t const*) const () from /usr/lib/libstdc++.so.6
  #2  0x00000000004833ed in Phrase::userFriendlyTerms (this=0x1425ac0) at algorithm/Phrase.cpp:56
  </code></pre>
  
  <p>Maybe I am blind or missing something ...</p>
  
  <p>Thanks for your help!</p>