From 7b54b4bc7b4eae32f92d3aa68b4d9fc432bee9d9 Mon Sep 17 00:00:00 2001 From: acidicoala <67734819+acidicoala@users.noreply.github.com> Date: Wed, 14 Jan 2026 19:34:00 +0500 Subject: [PATCH] Added null checks --- CMakeLists.txt | 2 +- KoalaBox | 2 +- src/smoke_api/smoke_api.cpp | 5 ++++- src/steam_api/steam_client.cpp | 4 +++- src/steam_api/steam_interfaces.cpp | 5 +---- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 44192ff..87425d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.24) -project(SmokeAPI VERSION 4.1.1) +project(SmokeAPI VERSION 4.1.3) include(KoalaBox/cmake/KoalaBox.cmake) add_subdirectory(KoalaBox) diff --git a/KoalaBox b/KoalaBox index 383a354..26c9a26 160000 --- a/KoalaBox +++ b/KoalaBox @@ -1 +1 @@ -Subproject commit 383a354d777b9614ae7fa796e81a8c4cfd384f75 +Subproject commit 26c9a26337257816001e2d1290eb9db9e0d00878 diff --git a/src/smoke_api/smoke_api.cpp b/src/smoke_api/smoke_api.cpp index 66c79e7..1330df3 100644 --- a/src/smoke_api/smoke_api.cpp +++ b/src/smoke_api/smoke_api.cpp @@ -224,7 +224,10 @@ namespace { if(const auto lib_bitness = kb::lib::get_bitness(lib_path)) { if(static_cast(*lib_bitness) == kb::platform::bitness) { if(const auto lib_handle = kb::lib::load(lib_path)) { - LOG_INFO("Found original library: {}", kb::path::to_str(lib_path)); + LOG_INFO( + "Found & loaded original library '{}' @ {}", + kb::path::to_str(lib_path), *lib_handle + ); original_steamapi_handle = *lib_handle; proxy_exports::init(self_module_handle, original_steamapi_handle); diff --git a/src/steam_api/steam_client.cpp b/src/steam_api/steam_client.cpp index 67c181e..a535c86 100644 --- a/src/steam_api/steam_client.cpp +++ b/src/steam_api/steam_client.cpp @@ -15,7 +15,9 @@ namespace steam_client { if(interface_version) { LOG_DEBUG("{} -> '{}' @ {}", function_name, interface_version, interface); - steam_interfaces::hook_virtuals(interface, interface_version); + if(interface) { + steam_interfaces::hook_virtuals(interface, interface_version); + } } return interface; diff --git a/src/steam_api/steam_interfaces.cpp b/src/steam_api/steam_interfaces.cpp index 4953f8a..6dd9ae3 100644 --- a/src/steam_api/steam_interfaces.cpp +++ b/src/steam_api/steam_interfaces.cpp @@ -237,13 +237,10 @@ namespace steam_interfaces { continue; } - const auto* const interface_ptr = ISteamClient_GetISteamGenericInterface( + ISteamClient_GetISteamGenericInterface( ARGS(steam_user, steam_pipe, interface_version.c_str()) ); - if(not interface_ptr) { - LOG_ERROR("Failed to get generic interface: '{}'", interface_version) - } } } catch(const std::exception& e) { LOG_ERROR("{} -> Unhandled exception: {}", __func__, e.what());