From dbbc5ec0be6db30aecd458dad9283e9e39e5370a Mon Sep 17 00:00:00 2001 From: Cheng-Chin Chiang Date: Thu, 28 Jul 2022 00:03:38 +0800 Subject: [PATCH 1/2] Check whether if the file loader is a nullptr before checking its updated time --- src/Session/Session.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Session/Session.cc b/src/Session/Session.cc index 4610647a6..fa8195580 100644 --- a/src/Session/Session.cc +++ b/src/Session/Session.cc @@ -49,7 +49,7 @@ std::shared_ptr LoaderCache::Get(const std::string& filename, const auto key = GetKey(filename, directory); // We have a cached loader, but the file has changed - if (_map.find(key) != _map.end() && _map[key]->ImageUpdated()) { + if ((_map.find(key) != _map.end()) && _map[key] && _map[key]->ImageUpdated()) { _map.erase(key); _queue.remove(key); } From 20c87b507c55bc84af44eb615cf9b92e84c9419a Mon Sep 17 00:00:00 2001 From: Cheng-Chin Chiang Date: Thu, 28 Jul 2022 12:05:09 +0800 Subject: [PATCH 2/2] Modify the changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c2440c11..821aaa4fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed region export failure when no write permission ([#1133](https://github.com/CARTAvis/carta-backend/pull/1133)). * Fixed HTTP response codes when returning response to PUT requests ([#1157](https://github.com/CARTAvis/carta-backend/issues/1157)). * Fixed the problem of one-pixel position offset for DS9 regions projections ([#1138](https://github.com/CARTAvis/carta-backend/issues/1138)). +* Fixed the crash when trying to load an unsupported image file ([#1161](https://github.com/CARTAvis/carta-backend/issues/1161)). ## [3.0.0-beta.3]