Skip to content

Commit

Permalink
Fix crash on images that have no labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Veulemans committed Apr 5, 2020
1 parent 2924fc5 commit 85d67de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/src/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ exports.exportProject = projectId => {
const labels = [];

project.form.formParts.forEach(({ id, type, name }) => {
if (labelData.labels == null || labelData.labels == undefined) {
console.log("No labels found for: " + id);
return;
}
const things = labelData.labels[id];
if (type === 'bbox' || type === 'polygon') {
function transform(points) {
Expand All @@ -33,6 +37,9 @@ exports.exportProject = projectId => {
y = Math.min(y, labelData.height);
return [x, y];
}
if (things == null || things == undefined) {
return;
}
things.forEach(({ points, tracingOptions }) => {
const pts =
tracingOptions && tracingOptions.enabled
Expand Down

0 comments on commit 85d67de

Please sign in to comment.