Skip to content

Commit

Permalink
Fix warning when there is no qgisProject set
Browse files Browse the repository at this point in the history
```
qrc:/qml/QFieldLocalDataPickerScreen.qml:332: TypeError: Cannot read property 'fileName' of null
```
  • Loading branch information
suricactus authored and nirvn committed Nov 14, 2023
1 parent 887fb2c commit 620cf6a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/qml/QFieldLocalDataPickerScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,10 @@ Page {
round: true

// Since the project menu only has one action for now, hide if PlatformUtilities.UpdateProjectFromArchive is missing
property bool isLocalProject: QFieldCloudUtils.getProjectId(qgisProject.fileName) === '' &&
(projectInfo.filePath.endsWith('.qgs') || projectInfo.filePath.endsWith('.qgz')) &&
platformUtilities.capabilities & PlatformUtilities.UpdateProjectFromArchive
property bool isLocalProject: qgisProject
&& QFieldCloudUtils.getProjectId(qgisProject.fileName) === ''
&& (projectInfo.filePath.endsWith('.qgs') || projectInfo.filePath.endsWith('.qgz'))
&& platformUtilities.capabilities & PlatformUtilities.UpdateProjectFromArchive
visible: (projectFolderView && isLocalProject && table.model.currentDepth === 1) || table.model.currentPath === 'root'

anchors.bottom: parent.bottom
Expand Down

1 comment on commit 620cf6a

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.