#tinyxml2 Exeption thrown read access violation

19 messages · Page 1 of 1 (latest)

manic egret
#

i tried to install tinyxml2 for my game and when i try to run my game it get this error: Exception thrown: read access violation. **this** was nullptr. and i dont know how i handle it correctly

willow boughBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

worthy silo
#

its a exception in the sense of cpu exception

#

Generally the solution is not to handle it after the fact, instead you prevent it from happening

worthy silo
#

In the case of a cpu its probably a crash to try and send that letter.
There are 2 scenarios you get a nullptr:

  1. intentional: So instead you check if the address is nullptr when you get the letter and then can do your own error handling based on that
  2. bug: so find the place its coming from and fix that so its not giving nullptr anymore
manic egret
#

so i need to pass something into the method where the exeption is to avoid the nullptr cpu error?

worthy silo
#

oh

#

wait kinda

#

depends what you mean

manic egret
#

right now i try to search where the compiler is complaining, what variable or file he dont find

worthy silo
#

yes

#

right so to be clear

void foo(int* i) {
  *i = 1;
}
```if `i` is `nullptr` this is an error, you are not able to assign an integer to a location where there can be no integer
To fix this you find all your `foo`s and make sure that they are not getting passed `nullptr`
manic egret
#

understandable smileysnek

willow boughBOT
#

@manic egret Has your question been resolved? If so, type !solved :)

manic egret
#

!solved