title: Erlang check empty string
body: <p>I'm new in Erlang development. I'm trying to read value of AccessToken from mnesia table (stored in 'users' table).</p>
  
  <p>In my code I've done:</p>
  
  <pre><code>BUser = boss_db:find(users, [{email, 'equals', MyEmail}]),
  [{_,_,BEmail,BName,BPassword,_,BAccessToken}] = BUser,
  io:format("User Details ~n~p~n", [BUser]),
  io:format("Access Token ~n~p~n", [BAccessToken]),
  .
  .
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>User Details 
  [{users,"users-1","mymail@someemail.org","Some Name","somepassword",'',''}]
  </code></pre>
  
  <p>The Last field is AccessToken and it is printed as:</p>
  
  <pre><code>Access Token 
  ''
  </code></pre>
  
  <p>If AccessToken value is non empty I'll do some operation.</p>
  
  <p>How do I check if AccessToken is empty or not?</p>
  
  <p>I tried:</p>
  
  <pre><code>AccessTokenLength = length(BAccessToken)
  if AccessTokenLength &gt; 0 -&gt;
  .
  .
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <pre><code>Error in controller error badarg [{erlang,length,[''],[]}
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>case binary_to_list(BAccessToken) =/= [] of
  true-&gt;
  false-&gt;
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <pre><code>Error in controller error badarg [{erlang,binary_to_list,[''],[]}
  </code></pre>
  
  <p>How do I check the empty condition properly?</p>