Menu ▾ ▴

#25 Setting wrong string

open
nobody
None
5
2005-01-18
2005-01-18
Anonymous
No

When I type ": set nu", or any invalid string, NullPointerException occurs.

I created very simple patch for viPlugin/preferences/commands/SetString.java

--- SetString.java.org 2005-01-19 01:35:40.000000000 +0900
+++ SetString.java 2005-01-19 01:35:43.000000000 +0900
@@ -23,6 +23,10 @@
String name,
String value)
{
+ try {
prefs.setValue(name, value);
+ } catch (NullPointerException e) {
+ // do nothing
+ }
}
}

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Sorry, I mistook. The patch should be as below(?)

    --- ViPreferenceService.java.org 2005-01-19 02:00:27.000000000 +0900
    +++ ViPreferenceService.java 2005-01-19 02:00:42.000000000 +0900
    @@ -63,7 +63,9 @@
    public void eval(String name, String value) {
    SetPrefCommand command = (SetPrefCommand) _prefCommands.get(name);

    + if (value != null) {
    command.execute(value);
    + }
    }

    public boolean getBoolean(String name) {

     

Log in to post a comment.