Fixed crash in test of files downloading / uploading

This commit is contained in:
David A. Velasco 2013-01-09 10:11:21 +01:00
parent a1a31b68d9
commit 35b25f04eb
2 changed files with 2 additions and 0 deletions

View file

@ -198,6 +198,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
* @param file A file that could be in the queue of downloads. * @param file A file that could be in the queue of downloads.
*/ */
public boolean isDownloading(Account account, OCFile file) { public boolean isDownloading(Account account, OCFile file) {
if (account == null || file == null) return false;
String targetKey = buildRemoteName(account, file); String targetKey = buildRemoteName(account, file);
synchronized (mPendingDownloads) { synchronized (mPendingDownloads) {
if (file.isDirectory()) { if (file.isDirectory()) {

View file

@ -324,6 +324,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
* @param file A file that could be in the queue of pending uploads * @param file A file that could be in the queue of pending uploads
*/ */
public boolean isUploading(Account account, OCFile file) { public boolean isUploading(Account account, OCFile file) {
if (account == null || file == null) return false;
String targetKey = buildRemoteName(account, file); String targetKey = buildRemoteName(account, file);
synchronized (mPendingUploads) { synchronized (mPendingUploads) {
if (file.isDirectory()) { if (file.isDirectory()) {