* i2psnark: Fix NPE when fetching invalid torrent (ticket #1307)

This commit is contained in:
zzz
2014-06-13 13:38:30 +00:00
parent e968828916
commit 83ccfb4596

View File

@ -178,7 +178,10 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl
// This may take a LONG time to create the storage.
_mgr.copyAndAddTorrent(file, canonical);
snark = _mgr.getTorrentByBaseName(originalName);
snark.startTorrent();
if (snark != null)
snark.startTorrent();
else
throw new IOException("Unknown error - check logs");
}
} catch (IOException ioe) {
_mgr.addMessage(_("Torrent at {0} was not valid", urlify(_url)) + ": " + ioe.getMessage());