Assertion Failed

I am by no mean good at C++ and have no idea what this means and how to fix it.
Assertion Failed!
Program: C:\Users\Evan\Desktop\1520450767.dll
File: src\DataChannel.cpp
Line: 598

Expression:
std::dynamic_pointer_cast<PackageMapSniffer>(connection->pkg_map)->is_guid_registered(netguide)

Can someone please help with a way to fix this. I've already tried reinstalling Ms Vis C++ 2015 and the program that is crashing. Thx
One possibility is that a function is called with wrong parameters.
Assertions are often used the check the pre-conditions of code.
However it could also be sth. else.
Without seeing the code it's impossible to tell what went wrong.

I've already tried reinstalling Ms Vis C++ 2015 and the program that is crashing. Thx
It has nothing to do with Visual Studio. Assertions are raised from the app or maybe the runtime libraries.

If the object pointed to by connection->pkg_map is not an instance of PackageMapSniffer, std::dynamic_pointer_cast() will return a null pointer. Attempting to dereference it with -> may cause an assertion failure.
A simple fix may be to just do
1
2
3
auto casted = std::dynamic_pointer_cast<PackageMapSniffer>(connection->pkg_map);
if (casted)
    casted->is_guid_registered(netguide);
Although if the developer wrote that line like that, perhaps they were expecting the object to be of the correct type, and if it's not then that could point to a bug somewhere else. It's difficult to say.
Topic archived. No new replies allowed.