-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if first is not empty #3333
Conversation
src/libsync/discovery.cpp
Outdated
@@ -177,7 +177,7 @@ void ProcessDirectoryJob::process() | |||
// For windows, the hidden state is also discovered within the vio | |||
// local stat function. | |||
// Recall file shall not be ignored (#4420) | |||
bool isHidden = e.localEntry.isHidden || (f.first[0] == '.' && f.first != QLatin1String(".sys.admin#recall#")); | |||
bool isHidden = e.localEntry.isHidden || (f.first.size() != 0 && f.first[0] == '.' && f.first != QLatin1String(".sys.admin#recall#")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FlexW Wouldn't f.isEmpty()
do the same as f.first.size() != 0
but look shorter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FlexW Also, I guess you forgot to add an assert and qcWarning. Just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes thats better:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allexzander I'm not sure if we should add a warning. The entry that caused trouble came from e2e. Maybe it is expected that some names are empty?
d81e8f1
to
9bfeaaa
Compare
/rebase |
9bfeaaa
to
39072b0
Compare
/rebase |
1 similar comment
/rebase |
If it's not checked that first is empty, crashes may happen. Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
39072b0
to
c9715db
Compare
AppImage file: Nextcloud-PR-3333-c9715db7202ec4bc69dd3c673597aee74ecf2b07-x86_64.AppImage |
If it's not checked that first is empty, crashes may happen.
Signed-off-by: Felix Weilbach felix.weilbach@nextcloud.com