Skip to content

Commit

Permalink
[qt6][Viewer] SequencePlayer: Fix null accesses
Browse files Browse the repository at this point in the history
When the SequencePlayer isn't available (when QtAliceVision has not been
loaded), the `viewer` element is null. All accesses to properties of this
object should thus be prevented.
  • Loading branch information
cbentejac committed Oct 2, 2024
1 parent 81d95b4 commit 41fbca0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Viewer/SequencePlayer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ FloatingPane {
verticalAlignment: Text.AlignVCenter
text: {
// number of cached frames is the difference between the first and last frame of all intervals in the cache
let cachedFrames = viewer.cachedFrames
let cachedFrames = viewer ? viewer.cachedFrames : []
let cachedFramesCount = 0
for (let i = 0; i < cachedFrames.length; i++) {
cachedFramesCount += cachedFrames[i].y - cachedFrames[i].x + 1
Expand Down Expand Up @@ -420,7 +420,7 @@ FloatingPane {
ProgressBar {
id: occupiedCacheProgressBar

property string occupiedCache: viewer.ramInfo ? Format.GB2SizeStr(viewer.ramInfo.y) : 0
property string occupiedCache: viewer && viewer.ramInfo ? Format.GB2SizeStr(viewer.ramInfo.y) : 0

width: parent.width

Expand Down

0 comments on commit 41fbca0

Please sign in to comment.