Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the crash when trying to load an unsupported image file #1163

Merged
merged 3 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
* Fixed including directories in region file list ([#1159](https://github.com/CARTAvis/carta-backend/issues/1159)).

## [3.0.0-beta.3]
Expand Down
2 changes: 1 addition & 1 deletion src/Session/Session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ std::shared_ptr<FileLoader> 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);
}
Expand Down