Skip to content

Commit f18de47

Browse files
committed
check with hasattr before calling js message callback
1 parent ee17c6e commit f18de47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

devdocs_desktop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def on_script_message(self, manager, data):
249249
data = json.loads(data.to_json(0))
250250
attr = data['callback']
251251

252-
if attr:
252+
if attr and hasattr(self, attr):
253253
callback = getattr(self, attr)
254254
callback(data['value'])
255255

0 commit comments

Comments
 (0)