is active can be NULL, check

This commit is contained in:
Dave Davenport 2016-03-03 08:09:36 +01:00
parent 51a4c252f4
commit 93b80be913
1 changed files with 6 additions and 0 deletions

View File

@ -112,6 +112,9 @@ int monitor_get_smallest_size ( void )
fprintf ( stderr, "Couldn't query Xinerama\n" );
return size;
}
if ( is_active == NULL ) {
return size;
}
if ( !is_active->state ) {
free ( is_active );
return size;
@ -150,6 +153,9 @@ int monitor_get_dimension ( int monitor, workarea *mon )
fprintf ( stderr, "Error getting screen info\n" );
return FALSE;
}
if ( is_active == NULL ) {
return FALSE;
}
if ( !is_active->state ) {
free ( is_active );
return FALSE;