mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge pull request #180 from misaochan/cursor-close
Fix NPE from cursor close
This commit is contained in:
commit
07e8245fdb
1 changed files with 5 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ import android.os.IBinder;
|
|||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -119,7 +120,9 @@ public class UploadController {
|
|||
contribution.setDataLength(length);
|
||||
}
|
||||
} catch(IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
Log.e("UploadController", "IO Exception: ", e);
|
||||
} catch(NullPointerException e) {
|
||||
Log.e("UploadController", "Null Pointer Exception: ", e);
|
||||
}
|
||||
|
||||
String mimeType = (String)contribution.getTag("mimeType");
|
||||
|
|
@ -142,10 +145,10 @@ public class UploadController {
|
|||
dateCreated = new Date();
|
||||
}
|
||||
contribution.setDateCreated(dateCreated);
|
||||
cursor.close();
|
||||
} else {
|
||||
contribution.setDateCreated(new Date());
|
||||
}
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
return contribution;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue