Skip to content

Commit b02a0ee

Browse files
committed
[Viewer] SequencePlayer: Prevent null accesses
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.
1 parent 3bac0d0 commit b02a0ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

meshroom/ui/qml/Viewer/SequencePlayer.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ FloatingPane {
385385
verticalAlignment: Text.AlignVCenter
386386
text: {
387387
// number of cached frames is the difference between the first and last frame of all intervals in the cache
388-
let cachedFrames = viewer.cachedFrames
388+
let cachedFrames = viewer ? viewer.cachedFrames : []
389389
let cachedFramesCount = 0
390390
for (let i = 0; i < cachedFrames.length; i++) {
391391
cachedFramesCount += cachedFrames[i].y - cachedFrames[i].x + 1
@@ -420,7 +420,7 @@ FloatingPane {
420420
ProgressBar {
421421
id: occupiedCacheProgressBar
422422

423-
property string occupiedCache: viewer.ramInfo ? Format.GB2SizeStr(viewer.ramInfo.y) : 0
423+
property string occupiedCache: viewer && viewer.ramInfo ? Format.GB2SizeStr(viewer.ramInfo.y) : 0
424424

425425
width: parent.width
426426

0 commit comments

Comments
 (0)