forked from mirror/openmw-tes3mp
SDLCursorManager: fix possibly invalid read when no cursor present
On android we have no cursor so I moved the check closer to usage
This commit is contained in:
parent
d2121ccd62
commit
a038327521
1 changed files with 4 additions and 9 deletions
|
@ -203,19 +203,14 @@ namespace SDLUtil
|
|||
void SDLCursorManager::cursorChanged(const std::string& name)
|
||||
{
|
||||
mCurrentCursor = name;
|
||||
|
||||
CursorMap::const_iterator curs_iter = mCursorMap.find(name);
|
||||
|
||||
if(curs_iter != mCursorMap.end())
|
||||
{
|
||||
//we have this cursor
|
||||
_setGUICursor(name);
|
||||
}
|
||||
_setGUICursor(name);
|
||||
}
|
||||
|
||||
void SDLCursorManager::_setGUICursor(const std::string &name)
|
||||
{
|
||||
SDL_SetCursor(mCursorMap.find(name)->second);
|
||||
auto it = mCursorMap.find(name);
|
||||
if (it != mCursorMap.end())
|
||||
SDL_SetCursor(it->second);
|
||||
}
|
||||
|
||||
void SDLCursorManager::createCursor(const std::string& name, int rotDegrees, osg::Image* image, Uint8 hotspot_x, Uint8 hotspot_y)
|
||||
|
|
Loading…
Reference in a new issue