title: Retrieving a fingerprint Blob is Crashing the app at run time, SQLITE for Android
body: <p><strong>The following errors have been logged</strong></p>
  
  <p>at com.github.omadahealth.lollipin.DatabaseHelper.userFP1(DatabaseHelper.java:400)
          at com.magtouch.app.gateopen$22.onUpCharSuccess(gateopen.java:777)
          at android_serialport_api.AsyncFingerprint.handleMessage(AsyncFingerprint.java:126)</p>
  
  <p><strong>Database Function</strong></p>
  
  <pre><code>public byte[] userFP1(int userID){
          SQLiteDatabase db = this.getWritableDatabase();
          Cursor cursor = db.query(TABLE_USERS, new String[]{FINGER_PRINT1}, USER_ID + "=?", new String[]{String.valueOf(userID)}, null, null, null, null);
  
          if (cursor != null) {
              cursor.moveToFirst();
          }
          return cursor.getBlob (10  );
  
      }
  </code></pre>
  
  <p><strong>code calling the database</strong></p>
  
  <pre><code>    if(db.userFP1 (i)!=null){
                          System.arraycopy( db.userFP1 ( i ), 0, tmp, 0, 256);
                          if(FPMatch.getInstance().MatchTemplate(model,tmp)&gt;60){
                              tvFpStatus.setText(getString( R.string.txt_fpmatchok));
                              break;
                          }
  Section pointed by the error from (AsyncFingerprint.java:126)
  if (msg.obj != null) {
                          onUpCharListener.onUpCharSuccess((byte[]) msg.obj);
                      } else {
                          onUpCharListener.onUpCharFail();
                      }
  </code></pre>