fix NullPointerException in Torrent.getPiece()