Skip to content

Commit 2316adc

Browse files
committed
fix: checking if the field distribution exists before using it
1 parent 1dbb4fc commit 2316adc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cernopendata/templates/cernopendata_records_ui/records/record_detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ <h2>Source code repository</h2>
455455
<h3>Files and indexes</h3>
456456
<div id="request-record-react-app" data-record-id="{{ record.recid }}"
457457
data-availability="{{ record.availability }}" class="pb-20"
458-
data-size="{{record.distribution.size}}" data-files="{{record.distribution.number_files}}"
458+
data-size="{{record.distribution.size if record.distribution else 0 }}" data-files="{{record.distribution.number_files if record.distribution else 0 }}"
459459
>
460460

461461
</div>

0 commit comments

Comments
 (0)