Lock camera to view with python blender 2.80

I got an error when running the code below (is part of addon) saying that the tabs or identation is not good:

class ADD_OT_nms_lockcamera(bpy.types.Operator):
	bl_idname = 'add.nms_lockcamera'
	bl_description = 'Lock to view'
	bl_category = 'NMS'
	bl_label = 'Lock to view'

	def execute(self, context):
		for area in bpy.context.screen.areas:
		   if area.type == 'VIEW_3D':
			  for space in area.spaces:
				 if space.type == 'VIEW_3D':
					space.lock_camera = True
		return {"FINISHED"}

ErrorTabsIndentation

Any Idea how to fix this?

I’m not python expert but it looks like you someties used tabs and sometimes spaces

Go to line 617, remove all tabs and spaces from the beggining of the line and then add tabs again.

I suppose so. Usually no problems with that since I use the menu: Format > Convert Whitespaces > to Tabs.

I will check it out manually as you said then try again.

Update: oh so simple was that, Why didn’t I think of that to do.
Thanks!