return a NULL instead of segfaulting when asserts are off
This commit is contained in:
parent
bcb8de973a
commit
efc875f5f2
1 changed files with 7 additions and 0 deletions
|
@ -171,9 +171,16 @@ public:
|
||||||
//! Returns a managed screen
|
//! Returns a managed screen
|
||||||
inline OBScreen *screen(int num) {
|
inline OBScreen *screen(int num) {
|
||||||
assert(num >= 0); assert(num < (signed)_screens.size());
|
assert(num >= 0); assert(num < (signed)_screens.size());
|
||||||
|
if (num >= screenCount())
|
||||||
|
return NULL;
|
||||||
return _screens[num];
|
return _screens[num];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Returns the number of managed screens
|
||||||
|
inline int screenCount() const {
|
||||||
|
return (signed)_screens.size();
|
||||||
|
}
|
||||||
|
|
||||||
//! Returns the mouse cursors used throughout Openbox
|
//! Returns the mouse cursors used throughout Openbox
|
||||||
inline const Cursors &cursors() const { return _cursors; }
|
inline const Cursors &cursors() const { return _cursors; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue