```
$ bazel analyze-profile profile
java.lang.NullPointerException
	at com.google.devtools.build.lib.runtime.commands.ProfileCommand.exec(ProfileCommand.java:251)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:552)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:331)
	at com.google.devtools.build.lib.runtime.BlazeRuntime.batchMain(BlazeRuntime.java:760)
	at com.google.devtools.build.lib.runtime.BlazeRuntime.main(BlazeRuntime.java:552)
	at com.google.devtools.build.lib.bazel.BazelMain.main(BazelMain.java:57)
java.lang.NullPointerException
	at com.google.devtools.build.lib.runtime.commands.ProfileCommand.exec(ProfileCommand.java:251)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:552)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:331)
	at com.google.devtools.build.lib.runtime.BlazeRuntime.batchMain(BlazeRuntime.java:760)
	at com.google.devtools.build.lib.runtime.BlazeRuntime.main(BlazeRuntime.java:552)
	at com.google.devtools.build.lib.bazel.BazelMain.main(BazelMain.java:57)
```
There's no need to call new String() here. Just pass in "<workspace>".
Bazel analyze-profile crashes outside of a workspace
I think that's a recent regression.
src/main/java/com/google/devtools/build/lib/runtime/commands/ProfileCommand.java
src/main/java/com/google/devtools/build/lib/runtime/commands/ProfileCommand.java
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/ProfileCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/ProfileCommand.java
index f39f0054b35774..b9f2fd7eb35813 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/ProfileCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/ProfileCommand.java
@@ -281,11 +281,18 @@ public BlazeCommandResult exec(final CommandEnvironment env, OptionsProvider opt
             PhaseSummaryStatistics phaseSummaryStatistics = new PhaseSummaryStatistics(info);
             EnumMap<ProfilePhase, PhaseStatistics> phaseStatistics =
                 new EnumMap<>(ProfilePhase.class);
+
+            Path workspace = env.getWorkspace();
             for (ProfilePhase phase : ProfilePhase.values()) {
               phaseStatistics.put(
                   phase,
                   new PhaseStatistics(
-                      phase, info, env.getWorkspace().getBaseName(), opts.vfsStatsLimit > 0));
+                      phase,
+                      info,
+                      (workspace == null
+                          ? "<workspace>"
+                          : workspace.getBaseName()),
+                      opts.vfsStatsLimit > 0));
             }
 
             CriticalPathStatistics critPathStats = new CriticalPathStatistics(info);
