* i2psnark:

- Fix NPE after create file failure
      - Sanitize more characters in file names
This commit is contained in:
zzz
2010-02-26 16:44:49 +00:00
parent 5fd4488e08
commit 299214aa1d
3 changed files with 34 additions and 6 deletions

View File

@ -425,9 +425,18 @@ public class SnarkManager implements Snark.CompleteListener {
FileInputStream fis = null;
try {
fis = new FileInputStream(sfile);
} catch (IOException ioe) {
// catch this here so we don't try do delete it below
addMessage(_("Cannot open \"{0}\"", sfile.getName()) + ": " + ioe.getMessage());
return;
}
try {
MetaInfo info = new MetaInfo(fis);
fis.close();
fis = null;
try {
fis.close();
fis = null;
} catch (IOException e) {}
if (!TrackerClient.isValidAnnounce(info.getAnnounce())) {
if (_util.shouldUseOpenTrackers() && _util.getOpenTrackers() != null) {