[API] Fix nHasDragDropPayload SIGSEGV when payload doesn't exist (#155)
`getDragDropPayload()` functions should simply return null when the payload doesn't exist. Currently, DearImGui will return NULL from `ImGui::GetDragDropPayload()` when the payload does not exist. This causes a null dereference since the nHasDragDropPayload function performs no NULL check
This commit is contained in:
1 parent
4f06b4e0de
commit
667d6108b8
1 file changed
+4
-2
@@ -5118,11 +5118,13 @@ public class ImGui {
|
||||
}
|
||||
|
||||
private static native boolean nHasDragDropPayload(); /*
|
||||
return ImGui::GetDragDropPayload()->Data != NULL;
|
||||
const ImGuiPayload* payload = ImGui::GetDragDropPayload();
|
||||
return payload != NULL && payload->Data != NULL;
|
||||
*/
|
||||
|
||||
private static native boolean nHasDragDropPayload(String dataType); /*
|
||||
return ImGui::GetDragDropPayload()->IsDataType(dataType);
|
||||
const ImGuiPayload* payload = ImGui::GetDragDropPayload();
|
||||
return payload != NULL && payload->IsDataType(dataType);
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user