mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
Directory Bug
The correct pattern to make a directory is: `if (!dir.mkdirs() && !dir.isDirectory()) { error }` mkdirs checks for exists so the exists check is redundant.
This commit is contained in:
parent
96d974f44d
commit
99ccc965bf
|
@ -139,7 +139,7 @@ public final class EncodeActivity extends Activity {
|
|||
|
||||
File bsRoot = new File(Environment.getExternalStorageDirectory(), "BarcodeScanner");
|
||||
File barcodesRoot = new File(bsRoot, "Barcodes");
|
||||
if (!barcodesRoot.exists() && !barcodesRoot.mkdirs()) {
|
||||
if (!barcodesRoot.mkdirs() && !barcodesRoot.isDirectory()) {
|
||||
Log.w(TAG, "Couldn't make dir " + barcodesRoot);
|
||||
showErrorMessage(R.string.msg_unmount_usb);
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue