mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Better error message if passing in invalid file path (e.g. because of not escaping cmdline args)
This commit is contained in:
parent
70f5565ddc
commit
d33ada22c1
@ -156,6 +156,11 @@ public class License {
|
||||
public static final MemoizedResource<License> INSTANCE = Resource.lazy(() -> parseLicenseFile(FILE.get()));
|
||||
|
||||
public static License importLicenseFile(File file) throws Exception {
|
||||
// require non-empty license file
|
||||
if (file.length() <= 0) {
|
||||
throw new FileNotFoundException("License file not found: " + file);
|
||||
}
|
||||
|
||||
// lock memoized resource while validating and setting a new license
|
||||
synchronized (License.INSTANCE) {
|
||||
// check if license file is valid and not expired
|
||||
|
Loading…
x
Reference in New Issue
Block a user