import bpy
from typing import assert_type
class ADDON_preferences(bpy.types.AddonPreferences):
def draw(self, context):
# "assert_type" mismatch: expected "UILayout" but received "UILayout | None"
assert_type(self.layout, bpy.types.UILayout)
layout = self.layout
# "box" is not a known attribute of "None"
box = layout.box()
# "row" is not a known attribute of "None"
row = layout.row()
Which leads to the issues in the
draw()
method: