Skip to content

Commit

Permalink
Safety Dance
Browse files Browse the repository at this point in the history
- Fixed issue with null/empty overrides
- Fixed issue with disabling a profile when the file watcher was not
active
- Fixed issue with editing a disabled profile
- Ensure installer is copying the correct DLLs
  • Loading branch information
gotdibbs committed Jun 24, 2015
1 parent dbe8d65 commit b7f5ff3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 11 deletions.
5 changes: 3 additions & 2 deletions Imposter.Fiddler.Installer/Imposter.Fiddler.Installer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@
</None>
</ItemGroup>
<ItemGroup>
<Content Include="..\Imposter.Fiddler\bin\Release\System.Windows.Interactivity.dll">
<None Include="..\Imposter.Fiddler\bin\Release\System.Windows.Interactivity.dll">
<Link>Scripts\System.Windows.Interactivity.dll</Link>
</Content>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
Expand Down
1 change: 1 addition & 0 deletions Imposter.Fiddler.Installer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ private void Install_Click(object sender, RoutedEventArgs e)
File.Copy("Scripts\\Imposter.Fiddler.dll", installLocation + "Imposter.Fiddler.dll", true);
File.Copy("Scripts\\imposter.js", installLocation + "imposter.js", true);
File.Copy("Scripts\\MahApps.Metro.dll", installLocation + "MahApps.Metro.dll", true);
File.Copy("Scripts\\System.Windows.Interactivity.dll", installLocation + "System.Windows.Interactivity.dll", true);

Tabs.SelectedIndex = _tabIndex = 1;
}
Expand Down
6 changes: 5 additions & 1 deletion Imposter.Fiddler/Helpers/PathHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public static string GetLocalFilePath(string urlFragment, string localDirectory,

foreach (var ovr in overrides)
{
if (urlFragment.Contains(ovr.RemoteFile.ToLower()) && CheckIfFileExists(ovr.LocalFile))
if (ovr != null &&
!string.IsNullOrEmpty(ovr.RemoteFile) &&
!string.IsNullOrEmpty(ovr.LocalFile) &&
urlFragment.Contains(ovr.RemoteFile.ToLower()) &&
CheckIfFileExists(ovr.LocalFile))
{
return ovr.LocalFile;
}
Expand Down
8 changes: 6 additions & 2 deletions Imposter.Fiddler/Imposter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,13 @@ private void ProfileEdit_Click(object sender, EventArgs e)
{
_enabledProfiles.RemoveAll(p => p.ProfileId == (Guid)parent.Tag);
_enabledProfiles.Add(profileEditor.Profile);
}

LoadProfileItems(profileEditor.Profile.Name);
LoadProfileItems(profileEditor.Profile.Name);
}
else
{
LoadProfileItems();
}
}
}

Expand Down
7 changes: 5 additions & 2 deletions Imposter.Fiddler/Models/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ public void Stop()
{
IsRunning = false;

_watcher.Dispose();
_watcher = null;
if (_watcher != null)
{
_watcher.Dispose();
_watcher = null;
}
}

public string GetFileMatch(string url)
Expand Down
4 changes: 2 additions & 2 deletions Imposter.Fiddler/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: Fiddler.RequiredVersion("2.2.8.6")]
7 changes: 5 additions & 2 deletions Imposter.Fiddler/Views/ProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ public partial class ProfileEditor : MetroWindow
public Profile Profile
{
get
{
{
var overrides = new List<Override>(Overrides.ItemsSource as IEnumerable<Override>);
overrides.RemoveAll(o => string.IsNullOrEmpty(o.LocalFile) || string.IsNullOrEmpty(o.RemoteFile));

return new Profile
{
ProfileId = ProfileId,
Name = Name.Text,
LocalDirectory = Local.Text,
RemoteUrl = Remote.Text,
Overrides = new List<Override>(Overrides.ItemsSource as IEnumerable<Override>)
Overrides = overrides
};
}
set
Expand Down

0 comments on commit b7f5ff3

Please sign in to comment.