title: Java timer error exception
body: <p>I have a strange error when executing a timertask, what cause it?</p>
  
  <pre><code>public void tick(long milliseconds) {
  ctimer = new Timer();
  ctimer.schedule(new TimerTask() {
  public void run() {
      System.out.println("sec"+sequencer.getMicrosecondPosition()/1000000);           }
  }, 0, milliseconds);
  }
  </code></pre>
  
  <p>Error message from command prompt:</p>
  
  <pre><code>Exception in thread "Timer-0" java.lang.NullPointerException
          at MidiTest$1.run(miditest.java:244)
          at java.util.TimerThread.mainLoop(Timer.java:555)
          at java.util.TimerThread.run(Timer.java:505)
  </code></pre>