Skip to content

Commit d0c4360

Browse files
author
veryben
committed
加载配置文件失败时不执行后续配置项读取和解析
1 parent 75931a8 commit d0c4360

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/csource/common/IniFileReader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class IniFileReader {
2525
/**
2626
* @param conf_filename config filename
2727
*/
28-
public IniFileReader(String conf_filename) throws FileNotFoundException, IOException {
28+
public IniFileReader(String conf_filename) throws IOException {
2929
this.conf_filename = conf_filename;
3030
loadFromFile(conf_filename);
3131
}
@@ -155,6 +155,7 @@ private void loadFromFile(String confFilePath) throws IOException {
155155

156156
private void readToParamTable(InputStream in) throws IOException {
157157
this.paramTable = new Hashtable();
158+
if (in == null) return;
158159
String line;
159160
String[] parts;
160161
String name;

0 commit comments

Comments
 (0)