codacy: Avoid declaring a variable if it is unreferenced before a possible exit point.

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2020-10-22 17:47:31 +02:00
parent fc324504f2
commit ccd05b51ba
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 3 additions and 3 deletions

View file

@ -144,7 +144,6 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
int accentColor = ThemeUtils.primaryAccentColor(getContext()); int accentColor = ThemeUtils.primaryAccentColor(getContext());
parentFolder = arguments.getParcelable(ARG_PARENT_FOLDER); parentFolder = arguments.getParcelable(ARG_PARENT_FOLDER);
Type type = Type.valueOf(arguments.getString(ARG_TYPE));
// Inflate the layout for the dialog // Inflate the layout for the dialog
LayoutInflater inflater = activity.getLayoutInflater(); LayoutInflater inflater = activity.getLayoutInflater();
@ -160,6 +159,7 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
throw new RuntimeException(e); // we'll NPE without the client throw new RuntimeException(e); // we'll NPE without the client
} }
Type type = Type.valueOf(arguments.getString(ARG_TYPE));
new FetchTemplateTask(this, client).execute(type); new FetchTemplateTask(this, client).execute(type);
listView.setHasFixedSize(true); listView.setHasFixedSize(true);

View file

@ -252,8 +252,6 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements Dial
return ""; return "";
} }
OCFile temp = FileStorageUtils.fillOCFile((RemoteFile) newFileResult.getData().get(0));
final ChooseTemplateDialogFragment fragment = chooseTemplateDialogFragmentWeakReference.get(); final ChooseTemplateDialogFragment fragment = chooseTemplateDialogFragmentWeakReference.get();
if (fragment == null) { if (fragment == null) {
return ""; return "";
@ -267,6 +265,8 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements Dial
FileDataStorageManager storageManager = new FileDataStorageManager(user.toPlatformAccount(), FileDataStorageManager storageManager = new FileDataStorageManager(user.toPlatformAccount(),
context.getContentResolver()); context.getContentResolver());
OCFile temp = FileStorageUtils.fillOCFile((RemoteFile) newFileResult.getData().get(0));
storageManager.saveFile(temp); storageManager.saveFile(temp);
file = storageManager.getFileByPath(path); file = storageManager.getFileByPath(path);