mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Directory Bug (#1046)
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
45d89bce80
|
@ -298,7 +298,7 @@ public final class HistoryManager {
|
|||
static Uri saveHistory(String history) {
|
||||
File bsRoot = new File(Environment.getExternalStorageDirectory(), "BarcodeScanner");
|
||||
File historyRoot = new File(bsRoot, "History");
|
||||
if (!historyRoot.exists() && !historyRoot.mkdirs()) {
|
||||
if (!historyRoot.mkdirs() && !historyRoot.isDirectory()) {
|
||||
Log.w(TAG, "Couldn't make dir " + historyRoot);
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue