Skip to content

Commit a78ef3e

Browse files
Ensure that if we don't have any values we don't crash
I'm a bit suspicious that re-enabling that exception might be unsafe, so let's be a bit friendlier.
1 parent 842e77a commit a78ef3e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProjectFactory.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,15 @@ public async Task<IWorkspaceProjectContext> CreateProjectContextAsync(Guid id, s
151151
const string itemName = BuildPropertyNames.IntermediateAssembly;
152152

153153
var values = data.GetItemValues(itemName);
154-
if (values.Length != 1)
154+
if (values.Length > 1)
155155
{
156156
var joinedValues = string.Join(";", values);
157157
throw new InvalidProjectDataException(itemName, joinedValues, $"Item group '{itemName}' is required to specify a single value: '{joinedValues}'.");
158158
}
159+
else if (values.Length == 0)
160+
{
161+
return null;
162+
}
159163

160164
var path = values[0];
161165

0 commit comments

Comments
 (0)