Skip to content

Commit c229548

Browse files
authored
fix: eventcallback crash (pointer uninitialized) (opentibiabr#2956)
1 parent 90e205d commit c229548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lua/callbacks/events_callbacks.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ class EventsCallbacks {
141141
bool allCallbacksSucceeded = true;
142142

143143
for (const auto &[name, callback] : getCallbacksByType(eventType)) {
144-
auto argsCopy = std::make_tuple(args...);
145144
if (callback && callback->isLoadedCallback()) {
145+
auto argsCopy = std::make_tuple(args...);
146146
bool callbackResult = std::apply(
147-
[&callback, &callbackFunc](auto &&... args) {
147+
[callback, &callbackFunc](auto &&... args) {
148148
return ((*callback).*callbackFunc)(std::forward<decltype(args)>(args)...);
149149
},
150150
argsCopy

0 commit comments

Comments
 (0)