title: How to avoid the error: terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid
body: <pre><code>if(player!=NULL)
      player-&gt;shuffled();
  </code></pre>
  
  <p>I do such things to avoid passing a null reference to a string constructor, but when compiling it still comes to error.</p>