mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #285 from PhenomRetroShare/Fix_SSGxsChannelGroupLoadNullError
Fix error "(EE) SSGxsChannelGroup::load() asked to load a null string.
This commit is contained in:
commit
20fcf635e4
@ -514,20 +514,20 @@ bool p3GxsChannels::setChannelDownloadDirectory(const RsGxsGroupId &groupId, con
|
||||
return true;
|
||||
}
|
||||
|
||||
bool p3GxsChannels::getChannelDownloadDirectory(const RsGxsGroupId & id,std::string& directory)
|
||||
bool p3GxsChannels::getChannelDownloadDirectory(const RsGxsGroupId & groupId,std::string& directory)
|
||||
{
|
||||
#ifdef GXSCHANNELS_DEBUG
|
||||
std::cerr << "p3GxsChannels::autoDownloadEnabled(" << id << ")" << std::endl;
|
||||
std::cerr << "p3GxsChannels::getChannelDownloadDirectory(" << id << ")" << std::endl;
|
||||
#endif
|
||||
|
||||
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
||||
|
||||
it = mSubscribedGroups.find(id);
|
||||
it = mSubscribedGroups.find(groupId);
|
||||
|
||||
if (it == mSubscribedGroups.end())
|
||||
{
|
||||
#ifdef GXSCHANNELS_DEBUG
|
||||
std::cerr << "p3GxsChannels::autoDownloadEnabled() No Entry" << std::endl;
|
||||
std::cerr << "p3GxsChannels::getChannelDownloadDirectory() No Entry" << std::endl;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
@ -904,7 +904,7 @@ void p3GxsChannels::handleResponse(uint32_t token, uint32_t req_type)
|
||||
/********************************************************************************************/
|
||||
|
||||
|
||||
bool p3GxsChannels::autoDownloadEnabled(const RsGxsGroupId &id,bool& enabled)
|
||||
bool p3GxsChannels::autoDownloadEnabled(const RsGxsGroupId &groupId,bool& enabled)
|
||||
{
|
||||
#ifdef GXSCHANNELS_DEBUG
|
||||
std::cerr << "p3GxsChannels::autoDownloadEnabled(" << id << ")";
|
||||
@ -913,7 +913,7 @@ bool p3GxsChannels::autoDownloadEnabled(const RsGxsGroupId &id,bool& enabled)
|
||||
|
||||
std::map<RsGxsGroupId, RsGroupMetaData>::iterator it;
|
||||
|
||||
it = mSubscribedGroups.find(id);
|
||||
it = mSubscribedGroups.find(groupId);
|
||||
if (it == mSubscribedGroups.end())
|
||||
{
|
||||
#ifdef GXSCHANNELS_DEBUG
|
||||
@ -934,15 +934,17 @@ bool p3GxsChannels::autoDownloadEnabled(const RsGxsGroupId &id,bool& enabled)
|
||||
|
||||
bool SSGxsChannelGroup::load(const std::string &input)
|
||||
{
|
||||
if(input.empty())
|
||||
{
|
||||
#ifdef GXSCHANNELS_DEBUG
|
||||
std::cerr << "SSGxsChannelGroup::load() asked to load a null string." << std::endl;
|
||||
#endif
|
||||
return true ;
|
||||
}
|
||||
int download_val;
|
||||
mAutoDownload = false;
|
||||
mDownloadDirectory.clear();
|
||||
|
||||
if(input.empty())
|
||||
{
|
||||
std::cerr << "(EE) SSGxsChannelGroup::load() asked to load a null string. Weird." << std::endl;
|
||||
return false ;
|
||||
}
|
||||
|
||||
RsTemporaryMemory tmpmem(input.length());
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
class SSGxsChannelGroup
|
||||
{
|
||||
public:
|
||||
|
||||
SSGxsChannelGroup(): mAutoDownload(false), mDownloadDirectory("") {}
|
||||
bool load(const std::string &input);
|
||||
std::string save() const;
|
||||
|
||||
@ -176,7 +176,7 @@ static uint32_t channelsAuthenPolicy();
|
||||
void updateSubscribedGroup(const RsGroupMetaData &group);
|
||||
void clearUnsubscribedGroup(const RsGxsGroupId &id);
|
||||
bool setAutoDownload(const RsGxsGroupId &groupId, bool enabled);
|
||||
bool autoDownloadEnabled(const RsGxsGroupId &id, bool &enabled);
|
||||
bool autoDownloadEnabled(const RsGxsGroupId &groupId, bool &enabled);
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user