From 72a9a502691a01578c06165bfe79097daafa2b05 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Tue, 20 Jan 2015 16:34:37 +0100 Subject: [PATCH] Fix startup if no binary is specified on the commandline --- src/core/InformationManager.cxx | 3 ++- src/disassembler/llvm/LLVMDisassembler.cxx | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/InformationManager.cxx b/src/core/InformationManager.cxx index 8f916ef..f0b6e1e 100644 --- a/src/core/InformationManager.cxx +++ b/src/core/InformationManager.cxx @@ -3,5 +3,6 @@ void InformationManager::reset(const std::string& filename) { disassembler.reset(createLLVMDisassembler(filename, this)); - disassembler.get()->start(); + if (disassembler.get() != NULL) + disassembler.get()->start(); } diff --git a/src/disassembler/llvm/LLVMDisassembler.cxx b/src/disassembler/llvm/LLVMDisassembler.cxx index 9ab2844..cf40aaa 100644 --- a/src/disassembler/llvm/LLVMDisassembler.cxx +++ b/src/disassembler/llvm/LLVMDisassembler.cxx @@ -13,6 +13,9 @@ using std::error_code; * */ Disassembler * createLLVMDisassembler(const std::string& filename, InformationManager* manager) { + if (filename == "") + return NULL; + std::unique_ptr o; o.reset(createBinary(filename).get()); const Binary * op = o.get(); -- 2.39.5