Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 196f0922 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

fix potential crash in OperationManagerService

parent fbd366c0
Loading
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -208,16 +208,24 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
                    break;
                case UNKNOWN_ERROR:
                    if (operation instanceof UploadFileOperation) {
                        if(result.getData() != null) {
                            int rowAffected = DbHelper.forceFoldertoBeRescan(((Long) result.getData().get(0)).intValue(), getApplicationContext());
                            Log.e(CURRENTTAG, " Upload failed for unknown reason.\n Force folder to be rescan next time (row affected) :" + rowAffected);
                        }else{
                            Log.w(CURRENTTAG, "result.getDate() for UploadFileOperation returned null");
                        }
                    } else if (operation instanceof DownloadFileOperation) {
                        Log.e(CURRENTTAG, " Download: Unknown_error : failed");
                    }
                    break;
                case FORBIDDEN:
                    if (operation instanceof UploadFileOperation) {
                        if(result.getData() != null){
                            int rowAffected = DbHelper.forceFoldertoBeRescan(((Long) result.getData().get(0)).intValue(), getApplicationContext());
                            Log.e(CURRENTTAG, " Upload: Forbidden : Can't get syncedFileState, no remote path defined. Force folder to be rescan next time (row affected) :" + rowAffected);
                        }else{
                            Log.w(CURRENTTAG, "result.getDate() for UploadFileOperation returned null");
                        }
                    } else if (operation instanceof DownloadFileOperation) {
                        Log.e(CURRENTTAG, "Download : Forbidden: Can't get syncedFileState, no local path defined");
                    }