Skip to content

Os.getOsFamily: return empty string instead of null#407

Closed
elharo wants to merge 1 commit into
masterfrom
fix/os-getosfamily-null
Closed

Os.getOsFamily: return empty string instead of null#407
elharo wants to merge 1 commit into
masterfrom
fix/os-getosfamily-null

Conversation

@elharo

@elharo elharo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #406

@elharo elharo requested a review from sparsick July 1, 2026 14:15
@slachiewicz slachiewicz added the bug Something isn't working label Jul 2, 2026
return fam;
}
}
return null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't find a contract, that ensures this piece of code should not be null. I'm afraid, that could have side effects in code that uses it.

For example:

if (Os.OS_FAMILY == null) {
}

This snippet would have another meaning after our change.

On the other side, the class Os is deprecated, so maybe it is okay to take this risk.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. probably better not to take it then.

@elharo elharo closed this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Os.getOsFamily() returns null when no family matches

3 participants