From 09d76203e8eeef91e7789c78f250dec61c951894 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 23 Jan 2023 22:35:15 -0800 Subject: [PATCH] handle library=None --- masque/ref.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masque/ref.py b/masque/ref.py index 0277b00..e9066d4 100644 --- a/masque/ref.py +++ b/masque/ref.py @@ -196,7 +196,7 @@ class Ref( raise PatternError('as_pattern() must be given a pattern or library.') if pattern is None and self.target is None: return None - if self.target not in library: + if library is not None and self.target not in library: raise PatternError(f'get_bounds() called on dangling reference to "{self.target}"') return self.as_pattern(pattern=pattern, library=library).get_bounds()