mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-20 12:24:24 -04:00
Fix ContentValue::ContentValue if GetAsxxx return false.
This commit is contained in:
parent
1d476de806
commit
61e5a62b9f
1 changed files with 19 additions and 17 deletions
|
@ -73,42 +73,44 @@ ContentValue::ContentValue(const ContentValue &from){
|
||||||
|
|
||||||
case INT32_TYPE:
|
case INT32_TYPE:
|
||||||
{
|
{
|
||||||
int32_t value;
|
int32_t value = 0;
|
||||||
from.getAsInt32(currKey, value);
|
if (from.getAsInt32(currKey, value))
|
||||||
put(currKey, value);
|
put(currKey, value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case INT64_TYPE:
|
case INT64_TYPE:
|
||||||
{
|
{
|
||||||
int64_t value;
|
int64_t value = 0;
|
||||||
from.getAsInt64(currKey, value);
|
if (from.getAsInt64(currKey, value))
|
||||||
put(currKey, value);
|
put(currKey, value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case STRING_TYPE:
|
case STRING_TYPE:
|
||||||
{
|
{
|
||||||
from.getAsString(currKey, val);
|
if (from.getAsString(currKey, val))
|
||||||
put(currKey, val);
|
put(currKey, val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BOOL_TYPE:
|
case BOOL_TYPE:
|
||||||
{
|
{
|
||||||
bool value;
|
bool value = false;
|
||||||
from.getAsBool(currKey, value);
|
if (from.getAsBool(currKey, value))
|
||||||
put(currKey, value);
|
put(currKey, value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DATA_TYPE:
|
case DATA_TYPE:
|
||||||
{
|
{
|
||||||
from.getAsData(currKey, data_len, src);
|
if (from.getAsData(currKey, data_len, src))
|
||||||
put(currKey, data_len, src);
|
put(currKey, data_len, src);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DOUBLE_TYPE:
|
case DOUBLE_TYPE:
|
||||||
double value;
|
{
|
||||||
from.getAsDouble(currKey, value);
|
double value = 0;
|
||||||
put(currKey, value);
|
if (from.getAsDouble(currKey, value))
|
||||||
break;
|
put(currKey, value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
std::cerr << "ContentValue::ContentValue(ContentValue &from):"
|
std::cerr << "ContentValue::ContentValue(ContentValue &from):"
|
||||||
<< "Error! Unrecognised data type!" << std::endl;
|
<< "Error! Unrecognised data type!" << std::endl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue