Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Fixup no-username bugs (crash and string change) #496

Merged
merged 2 commits into from
Mar 12, 2019

Conversation

jhugman
Copy link
Contributor

@jhugman jhugman commented Mar 11, 2019

Fixes #488.

This PR fixes a crash caused by kotlinx.android auto generated code being incorrectly generated and incorrectly used. This PR does not address the generated code, which allowed:

inputUsername.btnUsernameCopy

to be used, which resolves to null.

It also addresses an issue in autofill which caused strings containing "null" in display strings for autofill.

@jhugman jhugman requested a review from a team as a code owner March 11, 2019 12:28
@ghost ghost assigned jhugman Mar 11, 2019
@ghost ghost added the in progress label Mar 11, 2019
@jhugman jhugman force-pushed the jhugman/488-no-username-fixes branch from d5e7101 to d6f76ff Compare March 11, 2019 12:29
Copy link
Contributor

@eliserichards eliserichards left a comment

Choose a reason for hiding this comment

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

I'm a bit confused about what the intent of this card is. Does this actually fix the auto-generated code? And was that the only issue causing the crash?

setTextViewText(R.id.hostname, title)
}

datasetBuilder.setValue(
it,
AutofillValue.forText(credential.username),
AutofillValue.forText(credential.username ?: ""),
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens when the credential.username is null?

Copy link
Contributor Author

@jhugman jhugman Mar 12, 2019

Choose a reason for hiding this comment

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

When the credential.username is null, the empty string is used instead.

This means that the input field would be filled with the empty string rather than "null" (i.e. null.toString()).

Copy link
Contributor Author

@jhugman jhugman Mar 12, 2019

Choose a reason for hiding this comment

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

@eliserichards I've added steps to reproduce in the original issue #488. Please review when ready.

Copy link
Contributor

@eliserichards eliserichards left a comment

Choose a reason for hiding this comment

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

LGTM! 🥇

@eliserichards eliserichards merged commit f929df2 into master Mar 12, 2019
@ghost ghost removed the in progress label Mar 12, 2019
@devinreams devinreams deleted the jhugman/488-no-username-fixes branch May 3, 2019 20:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No username entry crashes with "null pointer item detail fragment"
2 participants