From af3471e499feb75a8f8aba384247aa25a08529c2 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 13 May 2015 10:50:02 +0000 Subject: Return null instead of throwing if compressor obj not available --- src/lib/compression/compression.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/compression') 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 t(get_transform(t_name)); - Compressor_Transform* r = dynamic_cast(t.get()); + if(!t) + return nullptr; + Compressor_Transform* r = dynamic_cast(t.get()); if(!r) throw std::runtime_error("Bad cast of compression object " + t_name); -- cgit v1.2.3