Skip to content

Commit

Permalink
Fix NRE, when the user didn't authenticate against the server when do…
Browse files Browse the repository at this point in the history
…ing a backup
  • Loading branch information
Fitzchak Yitzchaki committed Apr 2, 2012
1 parent b8bed90 commit 18b520f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
15 changes: 8 additions & 7 deletions Raven.Studio/Commands/BackupCommand.cs
Expand Up @@ -7,7 +7,7 @@ namespace Raven.Studio.Commands
{
public class BackupCommand : Command
{
private StartBackupTask startBackupTask;
private readonly StartBackupTask startBackupTask;
public BackupCommand(StartBackupTask startBackupTask)
{
this.startBackupTask = startBackupTask;
Expand All @@ -22,12 +22,13 @@ public override void Execute(object _)

DatabaseCommands.StartBackupAsync(location.Value)
.ContinueWith(task =>
{
startBackupTask.Status = new BackupStatus
{
IsRunning = true
};
}).Catch();
{
task.Wait(); // throws
startBackupTask.Status = new BackupStatus
{
IsRunning = true
};
}).Catch();
}
}
}
2 changes: 1 addition & 1 deletion Raven.Studio/Infrastructure/ErrorPresenter.cs
Expand Up @@ -73,7 +73,7 @@ private static void SetCustomMessageBasedOnTheActualError(StringWriter writer, E
{
case HttpStatusCode.Unauthorized:
case HttpStatusCode.Forbidden:
WriteCustomMessage("Could not authenticate against server", writer);
WriteCustomMessage("Could not authenticate against the server", writer);
break;
default:
using (var streamReader = new StreamReader(webResponse.GetResponseStream()))
Expand Down
3 changes: 0 additions & 3 deletions Raven.Studio/Models/QueryModel.cs
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Input;
using ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt;
using Raven.Client.Linq;
using Raven.Studio.Commands;
using Raven.Studio.Features.Query;
Expand Down

0 comments on commit 18b520f

Please sign in to comment.