mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 02:53:10 +01:00
Solve wrong casts
This commit is contained in:
@@ -134,10 +134,15 @@ public:
|
|||||||
RedisType::Ptr redisResult = readReply();
|
RedisType::Ptr redisResult = readReply();
|
||||||
if (redisResult->type() == ElementTraits<Error>::TypeId)
|
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)
|
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();
|
else throw BadCastException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user