title: How do I check if a column from a SQL database cursor is empty?
body: <p>I have database where they can enter in an image as one of the fields. The image is saved onto the phone and the URI is saved into the database.</p>
  
  <p>I'm having trouble when the user decides to not put in an image for an item. </p>
  
  <p>I'm trying to write an if/else statement, where the "if" condition checks if the cursor's image column is null. I just can't figure out what to type into the if condition.</p>
  
  <p>Here is the bit of code I'm working with. Basically I want to make it so that if the cursor's COLUMN_WINE_IMAGE is null, just make a toast. If it's not null, then set the image.</p>
  
  <pre><code>//This section turns the database's image URI stored in this cursor into a bitmap, and then sets the ImageView.
      Bitmap bitmap = null;
      try {
          if (............){
              Toast.makeText(this, "No image was taken for this item. (TOAST IS JUST TESTING PURPOSES)", Toast.LENGTH_SHORT).show();
          }else{
              bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), Uri.parse(cursor.getString(cursor.getColumnIndexOrThrow(WineContract.WineEntry.COLUMN_WINE_IMAGE))));
              mFullImage.setImageBitmap(bitmap);
          }
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>Here is an example of one of the things I tried with no success:</p>
  
  <pre><code>if (Uri.parse(cursor.getString(cursor.getColumnIndexOrThrow(WineContract.WineEntry.COLUMN_WINE_IMAGE))).equals(null)){ 
  
  //This returns error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.jeremy.sqlwine/com.example.jeremy.sqlwine.DetailsActivity}: java.lang.NullPointerException: uriString 
  </code></pre>