From 00e17a8d3b4b40a38358a81537f2d26441462993 Mon Sep 17 00:00:00 2001 From: drug007 Date: Thu, 2 Mar 2017 17:50:38 +0300 Subject: [PATCH] Prevent crashing if we create the project while current workspace is null. --- src/dlangide/workspace/project.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dlangide/workspace/project.d b/src/dlangide/workspace/project.d index 77b702d..bb2fd47 100644 --- a/src/dlangide/workspace/project.d +++ b/src/dlangide/workspace/project.d @@ -379,8 +379,10 @@ class Project : WorkspaceItem { super(fname); _workspace = ws; - foreach(obj; _workspace.includePath.array) - includePath ~= obj.str; + if (_workspace) { + foreach(obj; _workspace.includePath.array) + includePath ~= obj.str; + } _items = new ProjectFolder(fname); _dependencyVersion = dependencyVersion;