From e75b7b24bf7a2990a389a39845beee37c8cbdad3 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Thu, 26 Dec 2024 20:02:11 +0800 Subject: [PATCH] fix: validate imported_version type in AppDslService Signed-off-by: -LAN- --- api/services/app_dsl_service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/services/app_dsl_service.py b/api/services/app_dsl_service.py index 528a0dbcd39d9e..b6d6d05e589e92 100644 --- a/api/services/app_dsl_service.py +++ b/api/services/app_dsl_service.py @@ -176,6 +176,9 @@ def import_app( data["kind"] = "app" imported_version = data.get("version", "0.1.0") + # check if imported_version is a float-like string + if not isinstance(imported_version, str): + raise ValueError(f"Invalid version type, expected str, got {type(imported_version)}") status = _check_version_compatibility(imported_version) # Extract app data