Skip to content

Conversation

@p0lyh3dron
Copy link

When running this on my Debian 11 installation, the param name in get_sort_type_for_name would be null on startup. I assume returning 0 might cause issues, but the program worked flawlessly after adding this check.

get_sort_type_for_name(const char *name) {
if (!name) {
g_warning("[get_sort_type_for_name] name is nullptr");
return 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though the effect is exactly the same, I think it's a better idea to return DATABASE_INDEX_TYPE_NAME instead of 0. It's a little more descriptive, because it's considered the default sorting type.

@cboxdoerfer cboxdoerfer merged commit f853532 into cboxdoerfer:master Mar 3, 2022
@cboxdoerfer
Copy link
Owner

Thank you, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants