diff --git a/libIRDB/src/core/fileir.cpp b/libIRDB/src/core/fileir.cpp
index 3364a399db1b27c5764c58ed1fc07dc3ff3fb412..73442e61e260d3df04e694f2a53bce321b81e215 100644
--- a/libIRDB/src/core/fileir.cpp
+++ b/libIRDB/src/core/fileir.cpp
@@ -1866,6 +1866,11 @@ IRDB_SDK::Instruction_t* FileIR_t::addNewInstruction(
 	auto irdb_addr    = dynamic_cast<libIRDB::AddressID_t*>(addr);
 	auto irdb_indTarg = dynamic_cast<libIRDB::AddressID_t*>(indTarg);
 
+	if(irdb_addr==nullptr)
+	{
+		irdb_addr=dynamic_cast<libIRDB::AddressID_t*>(addNewAddress(getFile()->getBaseID(), 0));
+	}
+
 	auto newinsn=new libIRDB::Instruction_t(BaseObj_t::NOT_IN_DATABASE, irdb_addr, irdb_func, BaseObj_t::NOT_IN_DATABASE, bits, "", comment, irdb_indTarg, BaseObj_t::NOT_IN_DATABASE);
 	
 	GetInstructions().insert(newinsn);