Fix crash on ssh key add

https://fedorahosted.org/freeipa/ticket/3235
This commit is contained in:
Petr Vobornik
2013-04-30 17:52:31 +02:00
parent 13ad7da19a
commit 57c504a5b9

View File

@@ -3665,31 +3665,31 @@ IPA.sshkey_widget = function(spec) {
that.get_status = function() { that.get_status = function() {
var text = ''; var status = '';
var value = that.key.key; var value = that.key.key;
if (that.original_key) { if (that.original_key) {
if (value !== that.original_key) { if (value !== that.original_key) {
if (value === '') { if (value === '') {
text = text.get('@i18n:objects.sshkeystore.status_mod_ns'); status = text.get('@i18n:objects.sshkeystore.status_mod_ns');
} else { } else {
text = text.get('@i18n:objects.sshkeystore.status_mod_s'); status = text.get('@i18n:objects.sshkeystore.status_mod_s');
} }
} else { } else {
text = that.key.fingerprint; status = that.key.fingerprint;
} }
} else { } else {
if (!value || value === '') { if (!value || value === '') {
text = text.get('@i18n:objects.sshkeystore.status_new_ns'); status = text.get('@i18n:objects.sshkeystore.status_new_ns');
} else { } else {
text = text.get('@i18n:objects.sshkeystore.status_new_s'); status = text.get('@i18n:objects.sshkeystore.status_new_s');
} }
} }
return text; return status;
}; };
that.set_user_value = function(value) { that.set_user_value = function(value) {