Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 7f4925e

Browse files
authored
Merge pull request #9061 from mono/jstedfast-debugger-nre-updatecontents-fix
[Debugger] Node.Value can be null, if it is, use string.Empty
2 parents 51856a5 + afd4b98 commit 7f4925e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerObjectValueView.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ protected override void UpdateContents ()
133133
evaluateStatusIcon = Ide.Gui.Stock.Warning;
134134
} else if (Node.IsError || Node.IsNotSupported) {
135135
evaluateStatusIcon = Ide.Gui.Stock.Warning;
136-
strval = Node.Value;
136+
strval = Node.Value ?? string.Empty;
137137
int i = strval.IndexOf ('\n');
138138
if (i != -1)
139139
strval = strval.Substring (0, i);
140140
textColor = NSColor.FromCGColor (GetCGColor (Styles.ObjectValueTreeValueErrorText));
141141
} else if (Node.IsImplicitNotSupported) {
142-
strval = "";//val.Value; with new "Show Value" button we don't want to display message "Implicit evaluation is disabled"
142+
strval = string.Empty;//val.Value; with new "Show Value" button we don't want to display message "Implicit evaluation is disabled"
143143
textColor = NSColor.FromCGColor (GetCGColor (Styles.ObjectValueTreeValueDisabledText));
144144
if (Node.CanRefresh)
145145
valueButtonText = GettextCatalog.GetString ("Show Value");
@@ -154,7 +154,7 @@ protected override void UpdateContents ()
154154
} else {
155155
valueButtonText = GettextCatalog.GetString ("Show Values");
156156
}
157-
strval = "";
157+
strval = string.Empty;
158158
} else if (Node is AddNewExpressionObjectValueNode) {
159159
strval = string.Empty;
160160
editable = false;
@@ -222,7 +222,7 @@ protected override void UpdateContents ()
222222
}
223223

224224
// Second Item: Color Preview
225-
if (previewColor != null) {
225+
if (previewColor.HasValue) {
226226
colorPreview.Layer.BackgroundColor = GetCGColor (previewColor.Value);
227227

228228
if (!colorPreviewVisible) {

0 commit comments

Comments
 (0)