Skip to content

Commit

Permalink
Check whether Effect is not disposed; typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Feb 14, 2017
1 parent e86e8d9 commit 56daac6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FreePIE.Core.Plugins/Dx/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void SetConstantForce(int blockIndex, int magnitude)
{
CheckFfbSupport("Unable to set constant force");

if (Effects[blockIndex] == null)
if (Effects[blockIndex] == null || Effects[blockIndex].Disposed)
//As discussed in the SetEffectParams method, Set<EffectType> is called before an effect is created. So, instead of throwing an exception, just ignore.
return;// throw new Exception("No effect has been created in block " + blockIndex);

Expand Down
2 changes: 1 addition & 1 deletion FreePIE.Core.Plugins/VJoy/PacketAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void Call(IList<ICollection<Device>> registeredDevices)
action(dev, convertedPacket);
} catch (Exception e)
{
Console.WriteLine("Excecption when trying to forward:{0}\t{1}{0}\t{2}", Environment.NewLine, e.Message, e.StackTrace);
Console.WriteLine("Exception when trying to forward:{0}\t{1}{0}\t{2}", Environment.NewLine, e.Message, e.StackTrace);
//throw;
}
} else
Expand Down

0 comments on commit 56daac6

Please sign in to comment.