mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-06 12:56:55 +01:00
Solve wrong casts
This commit is contained in:
parent
f54a25f041
commit
1f1758f37c
@ -134,10 +134,15 @@ public:
|
||||
RedisType::Ptr redisResult = readReply();
|
||||
if (redisResult->type() == ElementTraits<Error>::TypeId)
|
||||
{
|
||||
throw RedisException(((Error*) redisResult.get())->getMessage());
|
||||
Type<Error>* error = dynamic_cast<Type<Error>*>(redisResult.get());
|
||||
throw RedisException(error->value().getMessage());
|
||||
}
|
||||
|
||||
if (redisResult->type() == ElementTraits<T>::TypeId)
|
||||
result = ((Type<T>*) redisResult.get())->value();
|
||||
{
|
||||
Type<T>* type = dynamic_cast<Type<T>*>(redisResult.get());
|
||||
if (type != NULL) result = type->value();
|
||||
}
|
||||
else throw BadCastException();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user