Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
Fixing null pointer exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Shytikov committed Jul 7, 2015
1 parent a84cdf2 commit 23afb8f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Cinteros.Xrm/AutoDeployTool/MainControl.cs
Expand Up @@ -109,7 +109,7 @@ private Guid GetAssemblyId(string fileName)
query.Criteria.AddCondition("culture", ConditionOperator.Equal, chunks[2]);
query.Criteria.AddCondition("publickeytoken", ConditionOperator.Equal, chunks[3]);

var plugin = this.Service.RetrieveMultiple(query).Entities.FirstOrDefault();
var plugin = this.Service == null ? null : this.Service.RetrieveMultiple(query).Entities.FirstOrDefault();

if (plugin != null)
{
Expand Down Expand Up @@ -192,7 +192,12 @@ private byte[] ReadFile(string fileName)

private void tsbClose_Click(object sender, EventArgs e)
{
this.Watcher.Changed -= this.Plugin_Changed;
// Preparing to dispose watcher
if (this.Watcher != null)
{
this.Watcher.Changed -= this.Plugin_Changed;
}

this.CloseTool();
}

Expand Down

0 comments on commit 23afb8f

Please sign in to comment.