Skip to content
Commit ed9cce2a authored by Oliver Hiorns's avatar Oliver Hiorns Committed by Fushan Wen
Browse files

Don't assume `QStandardPaths::locate` succeeds

A QFile was being constructed directly from the result of
`QStandardPaths::locate`, which can return an empty string if it fails
to find a matching file. Instead we should explicitly check the path is
valid by checking if the string is empty - the result of
QFile("").exists() is not documented in the Qt documentation, even
though the implementation (at time of writing) will return false as
expected, so this is effectively fixing undefined behaviour.
parent b394e37e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment