0

Iam building a UI using mplayer_python.

When I try to get the metadata, sometimes the following error happens

title = metadata.get ('Title','' )

-> AttributeError: 'NoneType' has no attribute 'get'

is there any way to check if the operation is valid

like

if SOMETHING : title = metadata.get ('Title','' )

??

Iam new to python so any help would be appreciated

Thanks in advance

Sebastian Heyn
  • 387
  • 3
  • 15

1 Answers1

2

This means that metadata is None. You can use if metadata.

badc0re
  • 3,333
  • 6
  • 30
  • 46