Skip to content

Commit a1f6e5d

Browse files
committed
fix: Nullsafe ThreadAffinity
When importing the json, nullcheck ThreadAffinity. This can be null, and should not try casting if it is null.
1 parent 696b237 commit a1f6e5d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/NativeCode/DynamicLibraryLoaderHelper/NativeRender/include/Config/PlatformConfig.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ namespace pew::eos::config
224224
}
225225
else if (name == "threadAffinity")
226226
{
227+
if (value.payload == 0)
228+
{
229+
// A payload of 0 means that threadAffinity should be null
230+
// Don't set it in this case
231+
return;
232+
}
233+
227234
const auto thread_affinity_json_object = *static_cast<json_object_s*>(value.payload);
228235
auto thread_affinity_iterator = thread_affinity_json_object.start;
229236

0 commit comments

Comments
 (0)