mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 02:34:23 -05:00
UI: Add null checks before doing some API calls
Harmless, but generated a debug warning for null pointers passed into the API.
This commit is contained in:
committed by
Ryan Foster
parent
51e3bd5e3d
commit
f9f4171d56
@@ -445,7 +445,8 @@ void OBSBasic::SetTransition(OBSSource transition)
|
||||
ui->transitionDurationLabel->setVisible(!fixed);
|
||||
ui->transitionDuration->setVisible(!fixed);
|
||||
|
||||
bool configurable = obs_source_configurable(transition);
|
||||
bool configurable = transition ? obs_source_configurable(transition)
|
||||
: false;
|
||||
ui->transitionRemove->setEnabled(configurable);
|
||||
ui->transitionProps->setEnabled(configurable);
|
||||
|
||||
|
||||
@@ -8639,7 +8639,7 @@ void OBSBasic::UpdateEditMenu()
|
||||
const bool canTransformSingle = videoCount == 1 && totalCount == 1;
|
||||
|
||||
OBSSceneItem curItem = GetCurrentSceneItem();
|
||||
bool locked = obs_sceneitem_locked(curItem);
|
||||
bool locked = curItem && obs_sceneitem_locked(curItem);
|
||||
|
||||
ui->actionCopySource->setEnabled(totalCount > 0);
|
||||
ui->actionEditTransform->setEnabled(canTransformSingle && !locked);
|
||||
|
||||
@@ -654,7 +654,7 @@ void OBSBasicPreview::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
void OBSBasicPreview::UpdateCursor(uint32_t &flags)
|
||||
{
|
||||
if (obs_sceneitem_locked(stretchItem)) {
|
||||
if (!stretchItem || obs_sceneitem_locked(stretchItem)) {
|
||||
unsetCursor();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user