git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#29 avoid potential NPE
[nikiroo-utils.git]
/
src
/
jexer
/
TDirectoryList.java
diff --git
a/src/jexer/TDirectoryList.java
b/src/jexer/TDirectoryList.java
index 642366b7e23c42f11bf1baedacb8363c15fa1e00..c47b33054e95e8c200a24ee8c80f307ef11a86fe 100644
(file)
--- a/
src/jexer/TDirectoryList.java
+++ b/
src/jexer/TDirectoryList.java
@@
-35,7
+35,7
@@
import java.util.List;
/**
* TDirectoryList shows the files within a directory.
*/
/**
* TDirectoryList shows the files within a directory.
*/
-public
final
class TDirectoryList extends TList {
+public class TDirectoryList extends TList {
/**
* Files in the directory.
/**
* Files in the directory.
@@
-73,6
+73,11
@@
public final class TDirectoryList extends TList {
}
}
setList(newStrings);
}
}
setList(newStrings);
+
+ // Select the first entry
+ if (getMaxSelectedIndex() >= 0) {
+ setSelectedIndex(0);
+ }
}
/**
}
/**