diff --git a/src/graphics/sp/sp_texture.cpp b/src/graphics/sp/sp_texture.cpp index 2ac799941..a8e73bede 100644 --- a/src/graphics/sp/sp_texture.cpp +++ b/src/graphics/sp/sp_texture.cpp @@ -522,7 +522,8 @@ std::shared_ptr { // Load colorization mask std::shared_ptr mask; - if (SP::getSPShader(m_material->getShaderName())->useAlphaChannel()) + SPShader* sps = SP::getSPShader(m_material->getShaderName()); + if (sps && sps->useAlphaChannel()) { Log::debug("SPTexture", "Don't use colorization mask or factor" " with shader using alpha channel for %s", m_path.c_str()); diff --git a/src/modes/world.cpp b/src/modes/world.cpp index db4468b6a..1781cab81 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -730,7 +730,8 @@ void World::resetAllKarts() for (KartList::iterator i = m_karts.begin(); i != m_karts.end(); i++) { if ((*i)->isGhostKart()) continue; - (*i)->getBody()->setGravity((*i)->getMaterial()->hasGravity() ? + (*i)->getBody()->setGravity( + (*i)->getMaterial() && (*i)->getMaterial()->hasGravity() ? (*i)->getNormal() * -g : Vec3(0, -g, 0)); } for(int i=0; i<60; i++) Physics::getInstance()->update(1.f/60.f);