Skip to content

Commit fd3c5f0

Browse files
committed
Add checks for SolutionDir not being empty in remaining uses
Does anyone even use the .props and .props.user stuff or should we delete that? Fixes #50
1 parent 90899f6 commit fd3c5f0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

KSPCommon.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@
8484

8585
<!-- Import a props.user file -->
8686
<!-- serves the same role as the csproj.user file -->
87-
<Import Condition=" Exists('$(SolutionDir)$(SolutionName).props.user') " Project="$(SolutionDir)$(SolutionName).props.user"/>
87+
<Import Condition=" '$(SolutionDir)' != '' And Exists('$(SolutionDir)$(SolutionName).props.user') " Project="$(SolutionDir)$(SolutionName).props.user"/>
8888

8989
<!-- Import solution-wide props if it exists -->
90-
<Import Condition=" Exists('$(SolutionDir)$(SolutionName).props') " Project="$(SolutionDir)$(SolutionName).props"/>
90+
<Import Condition=" '$(SolutionDir)' != '' And Exists('$(SolutionDir)$(SolutionName).props') " Project="$(SolutionDir)$(SolutionName).props"/>
9191

9292
<ItemGroup Condition=" exists('$(MSBuildThisFileDirectory)/include') " >
9393
<Compile

KSPCommon.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
<KSPBT_GameRootSource>environment variable</KSPBT_GameRootSource>
1616
</PropertyGroup>
1717
<ItemGroup>
18-
<KSPBT_GameRootCandidate Include="$(SolutionDir)KSP" source="solution directory"/>
18+
<KSPBT_GameRootCandidate Include="$(SolutionDir)KSP" source="solution directory" Condition=" '$(SolutionDir)' != '' "/>
1919
<KSPBT_GameRootCandidate Include="$(ReferencePath)" source="reference path"/>
2020
<KSPBT_GameRootCandidate Include="$(_KSPBT_SteamGameRoot)" source="steam"/>
2121
</ItemGroup>
2222

2323
<!-- Look for KSP install in Solution dir -->
24-
<PropertyGroup Condition=" '$(KSPBT_GameRoot)' == '' And Exists('$(SolutionDir)KSP/$(KSPBT_GameIdentifier)') ">
24+
<PropertyGroup Condition=" '$(KSPBT_GameRoot)' == '' And '$(SolutionDir)' != '' And Exists('$(SolutionDir)KSP/$(KSPBT_GameIdentifier)') ">
2525
<KSPBT_GameRoot>$(SolutionDir)KSP</KSPBT_GameRoot>
2626
<KSPBT_GameRootSource>solution directory</KSPBT_GameRootSource>
2727
</PropertyGroup>

0 commit comments

Comments
 (0)