CommandHelper

CommandHelper

46.5k Downloads

Printed stacktrace when installing cmdline mode

Pieter12345 opened this issue ยท 1 comments

commented

When running install-cmdline on a clean system, the following exception is printed:

java.lang.RuntimeException: Preferences have not been initialized!
        at com.laytonsmith.core.Prefs.prefS(Prefs.java:32)
        at com.laytonsmith.core.Prefs.TelemetryOn(Prefs.java:355)
        at com.laytonsmith.core.telemetry.Telemetry.doNag(Telemetry.java:87)
        at com.laytonsmith.core.Main$InstallCmdlineMode.execute(Main.java:425)
        at com.laytonsmith.core.Main.main(Main.java:243)

This exception does not affect the installation process, but it should just not be there.

Proposed fix: Remove Telemetry.GetDefault().doNag(); from Main.InstallCmdlineMode.execute(). It should already nag as soon as the user runs any MethodScript file.

commented

The preferences should be initialized before the Telemetry code, which should be just as easy. It's actually more preferable to keep the nag there, as it will (nearly) always run during installation, which is actually a better user experience than nagging in the REPL.