Skip to content

Commit

Permalink
Fix crash when there is an unknown file format inside palettes/ folder
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Jun 4, 2015
1 parent e0fea70 commit 59cdae7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/file/palette_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Palette* load_palette(const char *filename)
}
else {
FileFormat* ff = FileFormatsManager::instance()->getFileFormatByExtension(ext.c_str());
if (ff->support(FILE_SUPPORT_LOAD)) {
if (ff && ff->support(FILE_SUPPORT_LOAD)) {
FileOp* fop = fop_to_load_document(NULL, filename,
FILE_LOAD_SEQUENCE_NONE |
FILE_LOAD_ONE_FRAME);
Expand Down Expand Up @@ -108,7 +108,7 @@ bool save_palette(const char *filename, const Palette* pal)
}
else {
FileFormat* ff = FileFormatsManager::instance()->getFileFormatByExtension(ext.c_str());
if (ff->support(FILE_SUPPORT_SAVE)) {
if (ff && ff->support(FILE_SUPPORT_SAVE)) {
app::Context tmpContext;
doc::Document* doc = tmpContext.documents().add(
16, 16, doc::ColorMode::INDEXED,
Expand Down

0 comments on commit 59cdae7

Please sign in to comment.