2,779 questions
2
votes
1
answer
80
views
Code triggers unexpected null value in Firestore data call
I am working in Flutter on a web app. I am not a coder and I'm having issues with a very simple app that changes a color based on a boolean stored in Firestore. I'm seeking an understanding of how to ...
2
votes
1
answer
143
views
NullReferenceException when checking if the Model is null on a Razor Page
I have a situation where I am getting a NullReferenceException when I am checking a model (not a property) to see if it is null. Follow these steps to re-create the issue yourself.
Create a brand new ...
0
votes
1
answer
83
views
In a WebForms application, newly added control is null at runtime on published site but not in local debugging
I just added a new control in an existing page aspx file, assuring the validity of the markup and code itself by running it locally in debug shows correctly the new control and behaviors in page.
But ...
1
vote
0
answers
86
views
C# ASP.NET GridView - Row_Updating issues trying to get values from cells in the Gridview with NullReferenceException
There are 2 parts to my question. Please bear with me... just learning this stuff.
I have a GridView that allows editing, which will update a database table. Issue #1 is that I cannot seem to get the ...
0
votes
0
answers
16
views
Why is the debugger in universal windows app showing modelgen is null
I was running the code for a universal windows app when the debugger raised:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
modelGen was null.
The code is :
//...
1
vote
1
answer
517
views
Unity - Why is my Singleton throwing a NullReferenceException when I re-load the scene?
I am facing an issue with a NullReferenceException in my code. I've created a LevelManager script to manage the different scenes of my game. Inside this file ScoreKeeper object is called. This ...
2
votes
1
answer
58
views
C# - Creating a query in a SQL DB with EntityFrameWork - ERRO -> Value cannot be null. (Parameter 'source')
I'm trying to create the following query in C# with EntityFrameWork:
SELECT * FROM Companies WHERE Name LIKE '%(searchValue)%';
This is the table sample:
Company class:
public class Company {
...
1
vote
2
answers
196
views
unhandled System.NullReferenceException: on debug clean .net coreweb api / exception at System.Buffer.Memmove(Byte& dest, Byte& src, UIntPtr len)
i have last vs 2022 17.10.5 no updates possible
when i do new > asp.net core web api > some location >
create
and hit debug with no change
then it open browser with url https://localhost:...
1
vote
2
answers
99
views
Layout Cascading Parameter is null inside pages - Blazor Server
I am trying to pass the layout as a cascaded parameter to the page that uses the layout. The issue I am facing is that the layout cascaded parameter in the page is always null.
Here is the code I am ...
1
vote
0
answers
38
views
A non-null variable results me to NullReferenceException [Unity] [duplicate]
I've been on Unity for a very long time, yet I've come across the most common error.
I made a script to create a ship components store from a list of ScriptableObjects.
Here's the ScriptableObjects:
...
0
votes
1
answer
63
views
Application runs perfectly in Visual Studio, yet when the executable runs it throws NullReferenceException. File reading issue?
I have written a C# application in Visual Studio (using Avalonia, irrelevant for this question).
It runs perfectly in Visual Studio, yet when I try and run the executable, it throws a ...
1
vote
0
answers
114
views
How to fix Image variable that is null during playtesting?
So currently I’m making inventory functions for my Michael game. I was making a script called RespawnItem.
public class RespawnItem : MonoBehaviour
{
//----PUBLICS----//
public PlayerCollectingSystem ...
0
votes
1
answer
54
views
nullreferenceexception from ExecuteScalar()
I really don't know what to write here. I was just coding and this stuff happened.
connection.Open();
SqlCommand cmd = connection.CreateCommand();
cmd.CommandText = "select count(*) from ...
0
votes
0
answers
84
views
ListView.Items(0),Selected error System.nullreferenceexception
I'm trying to debug a program which uses a ListView to create a list of icons for files stored in a DB. I got the log of an exception stating System.nullreferenceexception: 'object reference not set ...
0
votes
0
answers
35
views
What parameter should I specify for Properties.Settings.Default.History so that it doesn't give an error with Null? [duplicate]
I create the "History" parameter through the project properties
and I'm trying to put a value in that parameter and save it:
Properties.Settings.Default.History.Add("00:30");
...
-2
votes
1
answer
61
views
Why do I get a null here?
So this piece of code
public boolean getBoolean(Integer Id) {
return Optional.of(Store.getMagazin(Id))
.map(MagazinDO::getBoolean)
.orElse(Boolean.FALSE);}
returns a null while ...
0
votes
1
answer
76
views
ASP.NET controls not rendering in runtime (are null) after AJAX call
I have the following aspx panel:
<asp:Panel ID="EndPanel" runat="server" CssClass="container" Visible="false">
<asp:Image ID="Border" ...
0
votes
1
answer
206
views
A weird NullReferenceException from J2N HashSet AddInNotPresent method that is called by Lucene.Net
I post part of the stack trace. This exception doesn't happen regularly and is hard to replicate. But it usually occurs after getting back from its IIS process idle.(Run it first, do nothing for a ...
1
vote
0
answers
1k
views
Encountered infinite recursion while looking up resource 'Arg_NullReferenceException' in System.Private.CoreLib
My program was developed in .Net 7 (VS 2022) and running on non-English Windows 10 (x64). Most of the time my program works normally. However, the following error (in Event Viewer) was thrown ...
0
votes
1
answer
64
views
Null reference but database has data
I have a problem for showing Level and Statues of course in course View enter image description here.
Here is my problem and the database does have data, but in add course service, it returns null in ...
0
votes
1
answer
82
views
asp.net find control inside runat div
I have this div in my markup
<form id="form1" runat="server">
<div class="mt-5">
<div id="d" runat="server"></div>
...
0
votes
1
answer
29
views
Nullable object must have a value in Context of Count Expression
I am receiving this error on a report page on my asp.net app. I have looked at the other answers to questions asked about this error, but am still unable to understand how to resolve it.
I am ...
-3
votes
1
answer
320
views
Converting null literal or possible null value to non-nullable type even if already checked for null [duplicate]
can anyone tell why the compiler is throwing the warning even if i checked everthing for null??
// check if non default accent color is selected
var accCol = await LocalSorage.GetItemAsync<string&...
1
vote
0
answers
79
views
Test Class runs before @beforeSuite Class which causes NullreferenceException on Webdriver
I am new to selenium and I am trying setup a Automation framework, I have two classes one for Webdriver (Base class) initialization and second is to run testScripts I have Marked the Webdriver ...
1
vote
0
answers
144
views
How/why does ModelState throw System.NullReferenceException when being checked for null?
UPDATE: To avoid the problem, I tried explicitly checking for null, thinking that surely there's no way it could possible still throw the exception.
It does.
The following line throws a System....