title: NullPointerException with Websocket in Processing Sketch
body: <p>I have set up an example in Processing which is working fine by utilising the Voice Recognition Library <a href="http://florianschulz.info/stt/" rel="nofollow noreferrer">http://florianschulz.info/stt/</a> </p>
  
  <p>I am trying to send the contents of a string to the Draw function and its causing a NullException error when you don't define a default value in void setup</p>
  
  <p>First I though that I should set up a global String msg but no matter how I try to define it it won't update the draw function with anything except the word test. This is because I have defined it inside void setup() as having the value "test"</p>
  
  <p>However if you remove the word test, it causes a null exception error again.</p>
  
  <p>What happens is that the String msg defaults to the value test  but once you speak into the laptop microphone, the console should update the word or sentence  through the text(); function and in turn appear in Processing java window with the updated word. </p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>import websockets.*;
  WebsocketServer socket;
  PFont f;
  String msg;
  
      void setup() {
  
        socket = new WebsocketServer(this, 1337, "/p5websocket");
        noLoop();
        size(480, 120);
        f = createFont("Arial",16,true); // Arial, 16 point, anti-aliasing on 
         if (msg == null){
           msg="test";
           println(msg);
        }
        else{
          println(msg);
  
        }
      }
  
      void draw() {
        background(100);
        textFont(f,36);
        fill(180);  
        println(msg);
        text(msg, 10, 10, 70, 80);// Text wraps within text box
  
      }
  
      void webSocketServerEvent(String msg){
  
        println(msg);
  
      }
  </code></pre>