diff options
author | lloyd <[email protected]> | 2015-05-13 10:50:02 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-05-13 10:50:02 +0000 |
commit | af3471e499feb75a8f8aba384247aa25a08529c2 (patch) | |
tree | b56c4a1a331aad38a27db33348cd6534e09dc1b3 | |
parent | c60eaffee7683136642e71c66311f5b494a1aa17 (diff) |
Return null instead of throwing if compressor obj not available
-rw-r--r-- | src/lib/compression/compression.cpp | 4 |
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); |