Questions tagged [argumentnullexception]

[MSDN] The exception that is thrown when a null reference is passed to a method that does not accept it as a valid argument.

MSDN ArgumentNullException is thrown when a method is invoked and at least one of the passed arguments is null but should never be null.

ArgumentNullException behaves identically to ArgumentException. It is provided so that application code can differentiate between exceptions caused by null arguments and exceptions caused by arguments that are not null. For errors caused by arguments that are not null, see ArgumentOutOfRangeException.

ArgumentNullException uses the HRESULT E_POINTER, which has the value 0x80004003.

For a list of initial property values for an instance of ArgumentNullException, see the ArgumentNullException constructors.

166 questions
0
votes
0 answers

Spinner.setSelected(false) and Spinner.setSelection(0,true) is working to solve null point exception except handset ex: Samsung sm-G31

In my android app, I was facing following error Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference onItemSelected Therefore I used location.setSelected(false) and…
0
votes
1 answer

Global DropDown list allways null

I am having struggles loading the data of drop downs when loading the page. I somehow always get an error that my object is null. When I debug it seems like the error in the PrepareViewBag() function raises before even executing the code in…
Gucci
  • 921
  • 1
  • 7
  • 27
0
votes
2 answers

Argument.NullException when dealing with Navigation Properties in Entity Framework

I am trying to return a list with all the Chat Buddies of a User. Chat Buddies meaning, all the UsersID's,where in messages I am the Sender or the Receiver. Here is my code: public List GetUserMessagesGrouped(string userId) { …
nouko
  • 11
  • 6
0
votes
1 answer

wp7 - application.current as app Value can not be null

I put some properties in the App.xaml.cs file which I am using to store data and populate textboxes as I navigate through my application: public String appRXName { set; get; } public String appRXNumber { set; get; } Originally I had a pivot…
webdad3
  • 8,893
  • 30
  • 121
  • 223
0
votes
0 answers

Collection object is missing if model state fails. Why?

I have a Model which contains properties and ICollection of files. [Required] public int SerialNo { get; set; } public Type Type {get; set;} [Required] public int TypeId public virtual ICollection Files { get; set; } Now, I am on my Edit…
Ashir K.
  • 121
  • 1
  • 12
0
votes
0 answers

ASP.NET MVC: System.ArgumentNullException: 'Value cannot be null. Parameter name: items'

I'm currently working on this assignment. Everything is working fine except when I put a drop-down list from another table. I need to insert a row in my database but I'm running across an error that says System.ArgumentNullException: 'Value cannot…
0
votes
1 answer

How to prevent pingSender.SendPingAsync from null exception in C#?

i have this method to send ping for a duration. public async Task TryToConnect(bool firstTime, int second) { var valueToReturne = false; if (firstTime) await Task.Delay(1200); var ct = new…
DiniMad
  • 49
  • 1
  • 9
0
votes
1 answer

System.ArgumentNullException, P10 NIL and proper dmp fie locations?

We have an application that is written in .NET 3.5. This app works on all our systems except one (the one that we had hoped it would work :/), where it has the following error in EventViewer ======================== Event Type: Error Event Source:…
Amir
  • 163
  • 2
  • 17
0
votes
3 answers

Why is this code giving me a null exception error here?

Why is there a null exception pointer error being thrown and how can i fix this thank you. If you could explain what to do. I am trying to store each line from a txt file into an arraylist which goes into a larger array list of seperate lines. …
0
votes
1 answer

ArgumentNullException when accessing a FormView instance

Background: I have an ASP.NET page which has a numebr of user controls within it. There are 2 user controls which are of interest. I need to display either one of them or neither of them, depending on the record selected previously. In the user…
David
  • 1,940
  • 3
  • 17
  • 30
0
votes
1 answer

NullArgumentException when Passing Arguments through Cmd

I've created a Windows Application using VB.Net that uses Sub Main to determine if the application should run a specific process or just open as a form for user interaction. Everything works great except for when I try to schedule my application…
0
votes
1 answer

C# razorview DropDownListFor 'Value cannot be null'

I am new to ASP.NET MVC and I'm working on my first project just for fun. I get this ArgumentNullException and I cannot figure out what's wrong. This is my model: public class SpeciesLabel { [Key] [Required] public string Name { get;…
0
votes
1 answer

VS Selenium - System.ArgumentNullException: text cannot be null Parameter name: text

I'm writing (Selenium) Unit Tests and am running into a NULL issue. This code was previously running and working, but now is failing and not entering values into the needed fields. Can anyone give me some suggestions as to what may be wrong? Unit…
0
votes
1 answer

List.AddRange throwing null argument exception despite null test

I have the lines if(query.GetRecordsFromResults() != null) RecordsList.AddRange(query.GetRecordsFromResults()); Where GetRecordsFromResults() returns IList. Despite the if condition, i get System.ArgumentNullException. Why is that ? The…
Ythio Csi
  • 379
  • 2
  • 14
0
votes
1 answer

Unity - argument null exception

Hi, I have a problem with simple login (from here https://github.com/bdodroid/SimpleScripts-LoginSystem) Everything works fine but when i want to log in it says: ArgumentNullException: Argument cannot be null. Parameter name: s System.Int32.Parse…