diff --git a/src/systems/scanning.cpp b/src/systems/scanning.cpp index 7464d7bc27..277c5cbd77 100644 --- a/src/systems/scanning.cpp +++ b/src/systems/scanning.cpp @@ -53,8 +53,8 @@ void ScanningSystem::scanningFinished(sp::ecs::Entity command_source) case ScanState::State::FullScan: break; } - - LuaConsole::checkResult(ss->on_scan_completed.call(scanner->target, command_source, scanner->source)); + if (ss->on_scan_completed) + LuaConsole::checkResult(ss->on_scan_completed.call(scanner->target, command_source, scanner->source)); } scanner->target = {};