You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/10/06 19:10:34 UTC
[airavata-django-portal] branch staging updated: Fixing null
reference checks
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/staging by this push:
new e97f0ce Fixing null reference checks
e97f0ce is described below
commit e97f0ce54414280d881a5c0f481f3a588af8a022
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Oct 6 15:09:56 2021 -0400
Fixing null reference checks
---
.../components/experiment/input-editors/RangeSliderInputEditor.vue | 5 ++---
.../js/components/experiment/input-editors/SliderInputEditor.vue | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/RangeSliderInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/RangeSliderInputEditor.vue
index 8276bb2..b529c5f 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/RangeSliderInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/RangeSliderInputEditor.vue
@@ -64,9 +64,8 @@ export default {
parseValue(value) {
// Just remove any percentage signs
const result = value
- .replaceAll("%", "")
- .split(this.delimiter)
- .map(parseFloat);
+ ? value.replaceAll("%", "").split(this.delimiter).map(parseFloat)
+ : [];
return result.length === 2 && !isNaN(result[0]) && !isNaN(result[1])
? result
: [this.min, this.max];
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/SliderInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/SliderInputEditor.vue
index 0c2b0c9..5d8affb 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/SliderInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/SliderInputEditor.vue
@@ -57,7 +57,7 @@ export default {
},
parseValue(value) {
// Just remove any percentage signs
- const result = parseInt(value.replaceAll("%", ""));
+ const result = parseInt(value ? value.replaceAll("%", "") : null);
return !isNaN(result) ? result : this.min;
},
onChange(value) {