stephenh / mirror

A tool for real-time, two-way sync for remote (e.g. desktop/laptop) development
Apache License 2.0
391 stars 37 forks source link

NullPointerException if "mirror client" executed without remote path argument #30

Open ajdavis opened 5 years ago

ajdavis commented 5 years ago

I just installed mirror on my macOS 10.13.6 laptop, and "mirror client" fails at startup:

> mirror client
2019-01-19 09:35:09 INFO  Increasing file limit to 9223372036854775807
Exception in thread "main" java.lang.NullPointerException
    at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:77)
    at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
    at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
    at java.nio.file.Paths.get(Paths.java:84)
    at mirror.Mirror$MirrorClientCommand.runIfChecksOkay(Mirror.java:191)
    at mirror.Mirror$BaseCommand.run(Mirror.java:100)
    at mirror.Mirror.main(Mirror.java:55)

This seems to happen no matter what options I pass. "mirror server" succeeds:

> mirror server
2019-01-19 09:36:09 INFO  Increasing file limit to 9223372036854775807
2019-01-19 09:36:10 INFO  Listening on 49172, version unspecified

I installed mirror like:

wget http://repo.joist.ws/mirror-all.jar ~/
wget http://repo.joist.ws/mirror ~/
ajdavis commented 5 years ago
> java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
ajdavis commented 5 years ago

Oh, this happens if I don't pass "-r" to "mirror client". I think mirror needs more helpful argument checking. =)