--- nsPasswordManager.cpp.orig 2007-01-26 13:54:08.000000000 +1300 +++ firefox-1.5.dfsg+1.5.0.9/toolkit/components/passwordmgr/base/nsPasswordManager.cpp 2007-01-26 14:16:28.000000000 +1300 @@ -945,14 +945,19 @@ } if (firstMatch && !attachedToInput) { - AttachToInput(userField); - + if (userField) { + AttachToInput(userField); + } + if (prefillForm) { nsAutoString buffer; - if (NS_FAILED(DecryptData(firstMatch->userValue, buffer))) - goto done; - userField->SetValue(buffer); + if (userField) { + if (NS_FAILED(DecryptData(firstMatch->userValue, buffer))) + goto done; + + userField->SetValue(buffer); + } if (NS_FAILED(DecryptData(firstMatch->passValue, buffer))) goto done;