V3125. The object was used after it was verified against null. Check lines: N1, N2.
V3125 The 'ct' object was used after it was verified against null. Check lines: 171, 163. ContentTypeControllerBase.cs 171
protected TContentType PerformPostSave<....>(....)
{
var ctId = Convert.ToInt32(....);
....
if (ctId > 0 && ct == null)
throw new HttpResponseException(HttpStatusCode.NotFound);
....
if ((....) &&
(ctId == 0 || ct.Alias != contentTypeSave.Alias))
....
}
Similar errors can be found in some other places:
V3125 The 'mainAssemblyList' object was used after it was verified against null. Check lines: 304, 291. ClassBrowserPad.cs 304
void UpdateActiveWorkspace()
{
var mainAssemblyList = SD.ClassBrowser.MainAssemblyList;
if ((mainAssemblyList != null) && (activeWorkspace != null)) {
....
}
....
mainAssemblyList.Assemblies.Clear();
....
}
V3125 The 'root' object was used after it was verified against null. Check lines: 103, 98. SettingsFileHandler.cs 103
protected XmlElement GetPropertyElement(....)
{
XmlElement root = _document.DocumentElement;
if (root == null)
if (!createIfNotExists)
return null;
else
CreateRootElement();
XmlElement entryElement = root.SelectSingleNode( // <=
"Property[@Name=\"" + entryName + "\"]") as XmlElement;
....
}
Similar errors can be found in some other places:
V3125 The 'resources' object was used after it was verified against null. Check lines: 215, 211. VisualPascalABCNET DesignerResourceService.cs 215
public System.Resources.IResourceReader
GetResourceReader(System.Globalization.CultureInfo info)
{
....
if (resources != null && resources.ContainsKey(info.Name)) {
resourceStorage = resources[info.Name];
} else {
resourceStorage = new ResourceStorage();
resources[info.Name] = resourceStorage; // <=
}
....
}
Similar errors can be found in some other places:
V3125 CWE-476 The 'camera' object was used after it was verified against null. Check lines: 184, 180. ARBackgroundRenderer.cs 184
protected void DisableARBackgroundRendering()
{
....
if (camera != null)
camera.clearFlags = m_CameraClearFlags;
// Command buffer
camera.RemoveCommandBuffer(CameraEvent.BeforeForwardOpaque,
m_CommandBuffer);
camera.RemoveCommandBuffer(CameraEvent.BeforeGBuffer,
m_CommandBuffer);
}
V3125 CWE-476 The 'item' object was used after it was verified against null. Check lines: 88, 85. TreeViewForAudioMixerGroups.cs 88
protected override Texture GetIconForItem(TreeViewItem item)
{
if (item != null && item.icon != null)
return item.icon;
if (item.id == kNoneItemID) // <=
return k_AudioListenerIcon;
return k_AudioGroupIcon;
}
Similar errors can be found in some other places:
V3125 [CWE-476] The 'state' object was used after it was verified against null. Check lines: 139, 127. AWSSDK.Core.Net45 RefreshingAWSCredentials.cs 139
private void UpdateToGeneratedCredentials(
CredentialsRefreshState state)
{
string errorMessage;
if (ShouldUpdate)
{
....
if (state == null)
errorMessage = "Unable to generate temporary credentials";
else
....
throw new AmazonClientException(errorMessage);
}
state.Expiration -= PreemptExpiryTime; // <=
....
}
Similar errors can be found in some other places:
V3125 The '_table' object was used after it was verified against null. Check lines: 437, 423. ConstraintCollection.cs 437
public void Clear()
{
if (_table != null)
....
if (_table.fInitInProgress && _delayLoadingConstraints != null)
....
....
}
V3125 The 'genericParameterConstraints' object was used after it was verified against null. Check lines: 603, 589. GenericSpecializationPartCreationInfo.cs 603
public static bool CanSpecialize(....)
{
....
object[] genericParameterConstraints = ....;
GenericParameterAttributes[] genericParameterAttributes = ....;
if ((genericParameterConstraints == null) &&
(genericParameterAttributes == null))
{
return true;
}
if ((genericParameterConstraints != null) &&
(genericParameterConstraints.Length != partArity))
{
return false;
}
if ((genericParameterAttributes != null) &&
(genericParameterAttributes.Length != partArity))
{
return false;
}
for (int i = 0; i < partArity; i++)
{
if (!GenericServices.CanSpecialize(
specialization[i],
(genericParameterConstraints[i] as Type[]).
CreateTypeSpecializations(specialization),
genericParameterAttributes[i]))
{
return false;
}
}
return true;
}
Similar errors can be found in some other places:
V3125 The 'entry' object was used after it was verified against null. Check lines: 270, 227. FtpControlStream.cs 270
protected override PipelineInstruction PipelineCallback(
PipelineEntry entry, ResponseDescription response, ....)
{
if (NetEventSource.IsEnabled)
NetEventSource.Info(this,
$"Command:{entry?.Command} Description:{response?.StatusDescription}");
....
if (entry.Command == "OPTS utf8 on\r\n")
....
....
}
V3125 The 'ours' object was used after it was verified against null. Check lines: 1212, 1204. ImmutableArray_1.cs 1212
bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
{
var self = this;
Array otherArray = other as Array;
if (otherArray == null)
{
var theirs = other as IImmutableArray;
if (theirs != null)
{
otherArray = theirs.Array;
if (self.array == null && otherArray == null) // <=
{
return true;
}
else if (self.array == null) // <=
{
return false;
}
}
}
IStructuralEquatable ours = self.array; // <=
return ours.Equals(otherArray, comparer); // <=
}
Similar errors can be found in some other places:
V3125 The 'n' object was used after it was verified against null. Check lines: 115, 111. CorrelationManager.cs 115
public override object Pop()
{
StackNode n = _stack.Value;
if (n == null) // <=
{
base.Pop();
}
_stack.Value = n.Prev; // <=
return n.Value;
}
V3125 The 'valueClauseName' object was used after it was verified against null. Check lines: 2320, 2318. DiagnosticAnalyzer.cs 2320
private SuppDiagReturnSymbolInfo SuppDiagReturnSymbol(....)
{
....
var valueClauseName = valueClauseMemberAccess.Name as IdentifierNameSyntax;
if (valueClauseName == null
|| valueClauseName.Identifier.Text != "Create")
{
ReportDiagnostic(context,
SuppDiagReturnValueRule,
valueClauseName.GetLocation(), // <=
propertyDeclaration.Identifier.Text);
return result;
}
....
}
V3125 The 'ifStatement' object was used after it was verified against null. Check lines: 788, 773. CodeFixProvider.cs 788
private async Task<Document> TriviaCountIncorrectAsync(
MethodDeclarationSyntax declaration)
{
SyntaxGenerator generator = SyntaxGenerator.GetGenerator(document);
....
var ifStatement = declaration.Body.Statements[2] as IfStatementSyntax;
if (ifStatement != null)
{
....
}
....
var oldBlock = ifStatement.Statement as BlockSyntax;
....
}
V3125 The 'startTime' object was used after it was verified against null. Check lines: 1752, 1738. AutomationPSClientDSC.cs 1752
private string GetNodeReportListFilterString(
....,
DateTimeOffset? startTime,
....,
DateTimeOffset? lastModifiedTime)
{
....
if (startTime.HasValue)
{
odataFilter.Add("properties/startTime ge " +
this.FormatDateTime(startTime.Value)); // <=
}
....
if (lastModifiedTime.HasValue)
{
odataFilter.Add("properties/lastModifiedTime ge " +
this.FormatDateTime(startTime.Value)); // <=
}
....
}
Similar errors can be found in some other places:
V3125 The 'CurrentAttachedMenu' object was used after it was verified against null. Check lines: 98, 96. PopupService.cs 98
private static void Overlay_PointerPressed(....)
{
if (CurrentAttachedMenu == null ||
!CurrentAttachedMenu.hitTestService
.HitTest(e.GetCurrentPoint(CurrentAttachedMenu)
.Position)
.Any())
{
CurrentAttachedMenu.IsOpen = false;
HideOverlay();
}
}
V3125 The 'omPropertyData' object was used after it was verified against null. Check lines: 156, 148. CodeGenerationUtilities.cs 156
private static string GetProtocolCollectionToObjectModelCollectionString(
...., PropertyData omPropertyData, ....)
{
if (IsMappedEnumPair(omPropertyData?.GenericTypeParameter, ....))
{
....
}
if (IsTypeComplex(omPropertyData.GenericTypeParameter))
....
}
V3125 The 'session' object was used after it was verified against null. Check lines: 69, 68. AmqpLinkCreator.cs 69
public async Task<Tuple<AmqpObject, DateTime>> CreateAndOpenAmqpLinkAsync()
{
....
AmqpSession session = null;
try
{
// Create Session
....
session = amqpConnection.CreateSession(amqpSessionSettings);
await session.OpenAsync(....).ConfigureAwait(false);
}
catch (Exception exception)
{
....
session?.Abort();
throw AmqpExceptionHelper.GetClientException(exception, null,
session.GetInnerException(), amqpConnection.IsClosing());
}
....
}
V3125 The 'item' object was used after it was verified against null. Check lines: 249, 247. ActiveTransactions.cs(249), ActiveTransactions.cs(247) Voron
public long ScanOldest()
{
....
for (int i = 0; i < copy.Length; i++)
{
var item = copy[i].Value;
if (item != null || item == InvalidLowLevelTransaction) // <=
{
if (val > item.Id) // <=
val = item.Id;
}
}
....
}
V3125 The 'logo' object was used after it was verified against null. Check lines: 236, 222. ConnectionLogic.cs 236
public ConnectionSwitchModLogic(....)
{
....
var logo = panel.GetOrNull<RGBASpriteWidget>("MOD_ICON");
if (logo != null)
{
logo.GetSprite = () =>
{
....
};
}
if (logo != null && mod.Icon == null) // <=
{
// Hide the logo and center just the text
if (title != null)
title.Bounds.X = logo.Bounds.Left;
if (version != null)
version.Bounds.X = logo.Bounds.X;
width -= logo.Bounds.Width;
}
else
{
// Add an equal logo margin on the right of the text
width += logo.Bounds.Width; // <=
}
....
}