X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FInstance.java;h=97e9868b8858ad2475b96cb7f51df3ae50d04683;hp=c48b119052ff24f5c184ccf89c79edf8dd78961c;hb=778d8d85f288c7b67c1a5156e5aedfc944997be0;hpb=b7afbe4297ae1f0c4db57cc431c2341b9fc6c061 diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index c48b119..97e9868 100644 --- 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()); - 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); @@ -110,6 +104,13 @@ public class Instance { 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"); @@ -200,6 +201,10 @@ public class Instance { * @return the {@link LocalLibrary} */ public static BasicLibrary getLibrary() { + if (lib == null) { + throw new NullPointerException("We don't have a library to return"); + } + return lib; }