forked from I2P_Developers/i2p.i2p
* i2psnark: Fix NPE when fetching invalid torrent (ticket #1307)
This commit is contained in:
@@ -178,7 +178,10 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl
|
|||||||
// This may take a LONG time to create the storage.
|
// This may take a LONG time to create the storage.
|
||||||
_mgr.copyAndAddTorrent(file, canonical);
|
_mgr.copyAndAddTorrent(file, canonical);
|
||||||
snark = _mgr.getTorrentByBaseName(originalName);
|
snark = _mgr.getTorrentByBaseName(originalName);
|
||||||
snark.startTorrent();
|
if (snark != null)
|
||||||
|
snark.startTorrent();
|
||||||
|
else
|
||||||
|
throw new IOException("Unknown error - check logs");
|
||||||
}
|
}
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
_mgr.addMessage(_("Torrent at {0} was not valid", urlify(_url)) + ": " + ioe.getMessage());
|
_mgr.addMessage(_("Torrent at {0} was not valid", urlify(_url)) + ": " + ioe.getMessage());
|
||||||
|
Reference in New Issue
Block a user