Skip to content

Commit

Permalink
Account for BinaryData::Ctor potentially failing
Browse files Browse the repository at this point in the history
  • Loading branch information
CouleeApps committed Feb 19, 2023
1 parent 3730dc8 commit 3758886
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,12 @@ int main(int argc, const char* argv[])
SetBundledPluginDirectory(GetBundledPluginDirectory());
InitPlugins();

Ref<BinaryData> bd = new BinaryData(new FileMetadata(argv[1]), argv[1]);
Ref<BinaryData> bd = BinaryData::CreateFromFilename(new FileMetadata(argv[1]), argv[1]);
if (!bd)
{
fprintf(stderr, "Could not open input file.\n");
return -1;
}
Ref<BinaryView> bv;
for (auto type : BinaryViewType::GetViewTypes())
{
Expand Down

0 comments on commit 3758886

Please sign in to comment.