diff options
author | Chad Dettmering <chad.dettmering@gmail.com> | 2015-02-27 01:31:49 +0300 |
---|---|---|
committer | Chad Dettmering <chad.dettmering@gmail.com> | 2015-02-27 01:31:49 +0300 |
commit | 2550e73081f8d9ab3fb56df4314f4253cbfb1e86 (patch) | |
tree | 694e612a0fb0885b50c6daae5fa6e23f057fc12b /mcs/class/Managed.Windows.Forms/System.Windows.Forms | |
parent | 6f14f86357a962f649d558526560015a6ecf59a0 (diff) |
Changed System.Windows.Forms.ToolStripManager.RevertMerge to return
false when given a null argument instead of throwing an exception.
According to the msdn here:
https://msdn.microsoft.com/en-us/library/b4e35dwy%28v=vs.110%29.aspx
this method should never throw an exception. This was also confirmed
with the official Microsoft runtime.
This change is released under the MIT license.
Diffstat (limited to 'mcs/class/Managed.Windows.Forms/System.Windows.Forms')
-rw-r--r-- | mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs index d85ae420f05..760ace67be3 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs @@ -354,13 +354,16 @@ namespace System.Windows.Forms public static bool RevertMerge (ToolStrip targetToolStrip) { + if (targetToolStrip == null) + return false; + return RevertMerge (targetToolStrip, targetToolStrip.CurrentlyMergedWith); } public static bool RevertMerge (ToolStrip targetToolStrip, ToolStrip sourceToolStrip) { if (sourceToolStrip == null) - throw new ArgumentNullException ("sourceToolStrip"); + return false; List<ToolStripItem> items_to_move = new List<ToolStripItem> (); |