Fix a crash with share scanner