Fix NullPointerException during RCP startup
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Wed, 25 Feb 2015 20:29:22 +0000 (15:29 -0500)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Thu, 26 Feb 2015 11:05:02 +0000 (06:05 -0500)
Change-Id: I49c7b490593088add311d073633e8ce6c943100a
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/42692
Reviewed-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.tracecompass.rcp.ui/src/org/eclipse/tracecompass/internal/tracing/rcp/ui/ApplicationWorkbenchWindowAdvisor.java

index fa6922096bcdde464c8349f50f4eac3f891ae4cc..2516a026694d8ab9c7b71f95838a68154be78133 100644 (file)
@@ -110,7 +110,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
         String traceToOpen = TracingRcpPlugin.getDefault().getCli().getArgument(CliParser.OPEN_FILE_LOCATION);
         String userHome = System.getProperty("user.home"); //$NON-NLS-1$
         // In case the application was not started on the shell, expand ~ to home directory
-        if (traceToOpen.startsWith("~/") && userHome != null) { //$NON-NLS-1$
+        if ((traceToOpen != null) && traceToOpen.startsWith("~/") && (userHome != null)) { //$NON-NLS-1$
             traceToOpen = traceToOpen.replaceFirst("^~", userHome); //$NON-NLS-1$
         }
 
This page took 0.03288 seconds and 5 git commands to generate.