summaryrefslogtreecommitdiff
path: root/libkms++
diff options
context:
space:
mode:
Diffstat (limited to 'libkms++')
-rw-r--r--libkms++/connector.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libkms++/connector.cpp b/libkms++/connector.cpp
index 325b610..e108410 100644
--- a/libkms++/connector.cpp
+++ b/libkms++/connector.cpp
@@ -96,6 +96,8 @@ void Connector::restore_mode()
Videomode Connector::get_default_mode() const
{
+ if (m_priv->drm_connector->count_modes == 0)
+ throw invalid_argument("no modes available\n");
drmModeModeInfo drmmode = m_priv->drm_connector->modes[0];
return drm_mode_to_video_mode(drmmode);