Skip to content

Commit 258939f

Browse files
committed
Fix setting of wrong (0, 0) location if the location is missing
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent e5af5ca commit 258939f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/frequenz/client/microgrid/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async def metadata(self) -> Metadata:
203203
return Metadata()
204204

205205
location: Location | None = None
206-
if microgrid_metadata.location:
206+
if microgrid_metadata.HasField("location"):
207207
location = Location(
208208
latitude=microgrid_metadata.location.latitude,
209209
longitude=microgrid_metadata.location.longitude,

0 commit comments

Comments
 (0)