Questions tagged as 'nullpointerexception'

3
answers

Difference of null and other proposition using this null object

If I have a code, for example: if(window!=null && window.isOpen()){ //todo } If window is null , will it still try to call the second proposition or not check anymore? Because if it tries to call, then it will give...
asked by 25.08.2016 / 14:06
3
answers

Method String.equals and NullPointerException

Although the doubt is very basic, I would like to understand why equals in this case: String texto = null; System.out.println("teste".equals(texto)); Return false normally (example in ideone ), but in the example bel...
asked by 22.03.2016 / 15:57
2
answers

Problem inserting data into a vector

I have the classes Port, Building and main: public class Porta { boolean aberta; String cor; double dimensaoX, dimensaoY, dimensaoZ; void abre() { this.aberta = true; } void fecha() { this.aberta = false; } void pinta(String cor) {...
asked by 24.05.2015 / 03:47
1
answer

NullPointException when inserting element into list

In the code below is a NullPointException, I tried to fix it without completely changing the code but it did not work, does anyone have a simple solution? I want to add a product in the List<Produto>produtos list there in the Bud...
asked by 08.03.2016 / 18:09
2
answers

... on a null object reference

Hello, I'm at a time with this problem and I can not find a solution, I've already looked at thousands of topics and I still can not understand why this error appeared for me. Error java.lang.NullPointerException: Attempt to invoke virtua...
asked by 27.09.2017 / 05:48
3
answers

Relationship Has-in C #?

I tried to make a relationship in C # and I'm not getting it and I do not even know if it's recommended to do it. Here is my error code:    System.NullReferenceException Object reference not set to an instance of an object. class Progra...
asked by 06.02.2015 / 00:15
1
answer

How to solve java.lang.NullPointerException?

I created the class Server ! However, an exception of type java.lang.NullPointerException is thrown! Could anyone help me with this problem? The class is as follows: public class Server { public static final int SERVERPORT...
asked by 15.01.2015 / 02:17
1
answer

NullReferenceException when calling function

I'm creating some unit tests for a class library that does manipulations in a database. The method being tested is this: public object ExecuteNoQueryOperation ( string spOrSqlInstructions, CommandType commandType = CommandType.StoredProcedu...
asked by 04.06.2016 / 20:01
1
answer

Method invocation may produce NullPointerException

I'm using geocoder to transform the address of the edit text into Longitude and Latitude. I have a problem with the app, but it does not cause any problem in the app, but it gets the error on the screen and I have to press ok every time, and it...
asked by 13.11.2015 / 01:02
1
answer

NullReferenceException using HtmlAgilityPack

I'd like to know how many tags <a> exist within div , but the NullReferenceException Exception is raised upon reaching XPath. var baseURL = "AQUI VAI A MINHA URL"; var client = new HtmlWeb(); var pagina = client.L...
asked by 05.07.2016 / 00:05