Skip to content

Commit 7b54b4b

Browse files
committed
Added null checks
1 parent 077096b commit 7b54b4b

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.24)
22

3-
project(SmokeAPI VERSION 4.1.1)
3+
project(SmokeAPI VERSION 4.1.3)
44

55
include(KoalaBox/cmake/KoalaBox.cmake)
66
add_subdirectory(KoalaBox)

KoalaBox

src/smoke_api/smoke_api.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,10 @@ namespace {
224224
if(const auto lib_bitness = kb::lib::get_bitness(lib_path)) {
225225
if(static_cast<uint8_t>(*lib_bitness) == kb::platform::bitness) {
226226
if(const auto lib_handle = kb::lib::load(lib_path)) {
227-
LOG_INFO("Found original library: {}", kb::path::to_str(lib_path));
227+
LOG_INFO(
228+
"Found & loaded original library '{}' @ {}",
229+
kb::path::to_str(lib_path), *lib_handle
230+
);
228231

229232
original_steamapi_handle = *lib_handle;
230233
proxy_exports::init(self_module_handle, original_steamapi_handle);

src/steam_api/steam_client.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ namespace steam_client {
1515
if(interface_version) {
1616
LOG_DEBUG("{} -> '{}' @ {}", function_name, interface_version, interface);
1717

18-
steam_interfaces::hook_virtuals(interface, interface_version);
18+
if(interface) {
19+
steam_interfaces::hook_virtuals(interface, interface_version);
20+
}
1921
}
2022

2123
return interface;

src/steam_api/steam_interfaces.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,10 @@ namespace steam_interfaces {
237237
continue;
238238
}
239239

240-
const auto* const interface_ptr = ISteamClient_GetISteamGenericInterface(
240+
ISteamClient_GetISteamGenericInterface(
241241
ARGS(steam_user, steam_pipe, interface_version.c_str())
242242
);
243243

244-
if(not interface_ptr) {
245-
LOG_ERROR("Failed to get generic interface: '{}'", interface_version)
246-
}
247244
}
248245
} catch(const std::exception& e) {
249246
LOG_ERROR("{} -> Unhandled exception: {}", __func__, e.what());

0 commit comments

Comments
 (0)