Changeset 285

Show
Ignore:
Timestamp:
09/27/08 02:43:18 PM (3 months ago)
Author:
octorian
Message:

Added try/catch for IllegalArgumentException whenever calling setText() with a person's name, and handling by only displaying the address if an exception is caught. (workaround fix for #108)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/LogicMail-1.0/LogicMail/src/org/logicprobe/LogicMail/ui/EmailAddressBookEditField.java

    r197 r285  
    142142 
    143143        if(this.name != null) { 
    144             this.setText(this.name); 
    145             this.setEditable(false); 
     144            try 
     145            { 
     146                this.setText(this.name); 
     147                this.setEditable(false); 
     148            } catch (IllegalArgumentException e) { 
     149                this.name = null; 
     150                this.setText(this.address); 
     151                this.setEditable(true); 
     152            } 
    146153        } 
    147154        else { 
     
    292299 
    293300                if(this.name != null) { 
    294                     this.setText(this.name); 
    295                     this.setEditable(false); 
     301                    try { 
     302                        this.setText(this.name); 
     303                        this.setEditable(false); 
     304                    } catch (IllegalArgumentException e) { 
     305                        this.name = null; 
     306                        this.setText(this.address); 
     307                        this.setEditable(true); 
     308                    } 
    296309                } 
    297310                else { 
     
    331344            address = email[choice]; 
    332345            name = contactItem.name; 
    333             this.setText(name); 
    334             this.setEditable(false); 
    335             inAddressBook = true; 
     346            try { 
     347                this.setText(name); 
     348                this.setEditable(false); 
     349                inAddressBook = true; 
     350            } catch (IllegalArgumentException e) { 
     351                name = null; 
     352                this.setText(address); 
     353                this.setEditable(true); 
     354                inAddressBook = false; 
     355            } 
    336356        } 
    337357        else { 
    338358            address = email[0]; 
    339359            name = contactItem.name; 
    340             this.setText(name); 
    341             this.setEditable(false); 
    342             inAddressBook = true; 
     360            try { 
     361                this.setText(name); 
     362                this.setEditable(false); 
     363                inAddressBook = true; 
     364            } catch (IllegalArgumentException e) { 
     365                name = null; 
     366                this.setText(address); 
     367                this.setEditable(true); 
     368                inAddressBook = false; 
     369            } 
    343370        } 
    344371    }