aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-05-13 10:50:02 +0000
committerlloyd <[email protected]>2015-05-13 10:50:02 +0000
commitaf3471e499feb75a8f8aba384247aa25a08529c2 (patch)
treeb56c4a1a331aad38a27db33348cd6534e09dc1b3
parentc60eaffee7683136642e71c66311f5b494a1aa17 (diff)
Return null instead of throwing if compressor obj not available
-rw-r--r--src/lib/compression/compression.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/compression/compression.cpp b/src/lib/compression/compression.cpp
index 499fc1adf..0e0221fe6 100644
--- a/src/lib/compression/compression.cpp
+++ b/src/lib/compression/compression.cpp
@@ -59,8 +59,10 @@ Compressor_Transform* do_make_compressor(const std::string& type, const std::str
std::unique_ptr<Transform> t(get_transform(t_name));
- Compressor_Transform* r = dynamic_cast<Compressor_Transform*>(t.get());
+ if(!t)
+ return nullptr;
+ Compressor_Transform* r = dynamic_cast<Compressor_Transform*>(t.get());
if(!r)
throw std::runtime_error("Bad cast of compression object " + t_name);