title: "java.lang.NullPointerException: Attempt to write to null array" for int[][] var = new int[m][n]
body: <p>I'm getting this weird exception report from other users:</p>
  
  <pre><code>java.lang.NullPointerException: Attempt to write to null array
      at yuku.alkitab.base.util.Levenshtein.distance(Levenshtein.java:16)
  </code></pre>
  
  <p>The relevant snippet is:</p>
  
  <pre><code>private static final int deletion = 500;
  
  public static int distance(String s, String t) {
      // d is a table with m+1 rows and n+1 columns
      int m = s.length();
      int n = t.length();
  
      int[][] d = new int[m + 1][n + 1];
  
      for (int i = 0; i &lt;= m; i++) {
          d[i][0] = i * deletion; // &lt;------ this is line 16
      }
  
      // more lines omitted
  }
  </code></pre>
  
  <p>Examining the above code I could not find out how that exception can ever happened. Did I miss something?</p>
  
  <p>All crash reports came from Android 6.0, API 23.</p>