You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the table is not sortable, calling tableGetSortSpecs results in a crash, rather than returning null as documented (there is a simple workaround of checking if its sortable, so not a high priority problem)
/**
* Get latest sort specs for the table (NULL if not sorting).
* Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable().
*/
public static ImGuiTableSortSpecs tableGetSortSpecs() {
return new ImGuiTableSortSpecs(nTableGetSortSpecs());
}
Reproduction
call tableGetSortSpecs on a table without setting the Sortable flag
Yes, the issue does exist, but a valid approach in this situation would be to check if (tableGetSortSpecs().isValidPtr()). In the way how it works isValidPtr() is equivalent to if (tableGetSortSpecs() != null).
I guess this is a more general stylistic question, whether the imgui-java APIs return nulls or non-nulls with isValidPtr false. Perhaps null would be safer as a policy (NPE rather than JVM crash on dereferencing). But I'm okay with closing this specific ticket.
Version
1.89.0
What happened?
When the table is not sortable, calling
tableGetSortSpecs
results in a crash, rather than returning null as documented (there is a simple workaround of checking if its sortable, so not a high priority problem)Reproduction
call tableGetSortSpecs on a table without setting the Sortable flag
Relevant log output
The text was updated successfully, but these errors were encountered: