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
Fix name of imported cbz, fix library check
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
fanfix
/
Instance.java
diff --git
a/src/be/nikiroo/fanfix/Instance.java
b/src/be/nikiroo/fanfix/Instance.java
index c48b119052ff24f5c184ccf89c79edf8dd78961c..97e9868b8858ad2475b96cb7f51df3ae50d04683 100644
(file)
--- a/
src/be/nikiroo/fanfix/Instance.java
+++ b/
src/be/nikiroo/fanfix/Instance.java
@@
-82,12
+82,6
@@
public class Instance {
uiconfig = new UiConfigBundle();
trans = new StringIdBundle(getLang());
uiconfig = new UiConfigBundle();
trans = new StringIdBundle(getLang());
- try {
- lib = new LocalLibrary(getFile(Config.LIBRARY_DIR));
- } catch (Exception e) {
- syserr(new IOException("Cannot create library for directory: "
- + getFile(Config.LIBRARY_DIR), e));
- }
boolean debug = Instance.getConfig()
.getBoolean(Config.DEBUG_ERR, false);
boolean debug = Instance.getConfig()
.getBoolean(Config.DEBUG_ERR, false);
@@
-110,6
+104,13
@@
public class Instance {
tracer.setShowErrorDetails(debug);
tracer.setShowTraces(trace);
tracer.setShowErrorDetails(debug);
tracer.setShowTraces(trace);
+ try {
+ lib = new LocalLibrary(getFile(Config.LIBRARY_DIR));
+ } catch (Exception e) {
+ syserr(new IOException("Cannot create library for directory: "
+ + getFile(Config.LIBRARY_DIR), e));
+ }
+
// Could have used: System.getProperty("java.io.tmpdir")
if (tmp == null) {
tmp = new File(configDir, "tmp");
// Could have used: System.getProperty("java.io.tmpdir")
if (tmp == null) {
tmp = new File(configDir, "tmp");
@@
-200,6
+201,10
@@
public class Instance {
* @return the {@link LocalLibrary}
*/
public static BasicLibrary getLibrary() {
* @return the {@link LocalLibrary}
*/
public static BasicLibrary getLibrary() {
+ if (lib == null) {
+ throw new NullPointerException("We don't have a library to return");
+ }
+
return lib;
}
return lib;
}