From 746c4eff48a2256faf428918198dc83d75b58206 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 16 Oct 2023 17:34:59 -0400 Subject: [PATCH] msubprojects: Fix crash if wrapdb_version is in bad format Fixes: #12378 --- mesonbuild/msubprojects.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py index 874364e18..6b107c063 100755 --- a/mesonbuild/msubprojects.py +++ b/mesonbuild/msubprojects.py @@ -155,6 +155,11 @@ class Runner: try: wrapdb_version = self.wrap.get('wrapdb_version') branch, revision = wrapdb_version.split('-', 1) + except ValueError: + if not options.force: + self.log(' ->', mlog.red('Malformed wrapdb_version field, use --force to update any way')) + return False + branch = revision = None except WrapException: # Fallback to parsing the patch URL to determine current version. # This won't work for projects that have upstream Meson support.