title: Getting "Attempt to get length of null array" error
body: <p>I m getting "Attempt to get length of null array" error.
  I m trying to fetch the random quotes as following from the link <a href="https://gturnquist-quoters.cfapps.io/api/random" rel="nofollow noreferrer">https://gturnquist-quoters.cfapps.io/api/random</a> when I try to click the button :
  type    "success"
  value<br>
  id  7
  quote   "The real benefit of Boot, however, is that it's just Spring. That means any direction the code takes, regardless of complexity, I know it's a safe bet."</p>
  
  <p>MainActivity.java</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      Button btnCallRestApi;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  
          btnCallRestApi = findViewById(R.id.btnCallRestApi);
          btnCallRestApi.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  //call Rest Api
                  new HttpReqTask().execute();
  
              }
          });
      }
      private class HttpReqTask extends AsyncTask&lt;Void, Void, Value[]&gt; {
          @Override
          protected Value[] doInBackground(Void... params){
              try{
                  String apiUrl = "https://gturnquist-quoters.cfapps.io/api/random";
                  RestTemplate rest = new RestTemplate();
                  rest.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
                  Value[] quotes = rest.getForObject(apiUrl, Value[].class);
                  return quotes;
              }catch (Exception ex){
                  Log.e("Could not get Quotes",ex.getMessage());
              }
              return null;
          }
          protected void onPostExecute(Value[] quotes){
              super.onPostExecute(quotes);
              for(Value v:quotes){
                  Log.i("id: ", String.valueOf(v.getId()));
                  Log.i("quote: ", v.getQuote());
              }
          }
      }
  }
  </code></pre>
  
  <p>Quote.java</p>
  
  <pre><code> public Quote() {
      }
  
      public String getType() {
          return type;
      }
  
      public void setType(String type) {
          this.type = type;
      }
  
      public Value getValue() {
          return value;
      }
  
      public void setValue(Value value) {
          this.value = value;
      }
  
      @Override
      public String toString() {
          return "Quote{" +
                  "type='" + type + '\'' +
                  ", value=" + value +
                  '}';
      }
  </code></pre>
  
  <p>Value.java</p>
  
  <pre><code> public Value() {
      }
  
      public Long getId() {
          return this.id;
      }
  
      public String getQuote() {
          return this.quote;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public void setQuote(String quote) {
          this.quote = quote;
      }
  
      @Override
      public String toString() {
          return "Value{" +
                  "id=" + id +
                  ", quote='" + quote + '\'' +
                  '}';
      }
  </code></pre>