<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def selected_canvas_hazlayer(self):
 """Obtain the canvas layer selected by user. :returns: The currently selected map layer in the list. :rtype: QgsMapLayer """


        if self.lstCanvasHazLayers.selectedItems():
            item = self.lstCanvasHazLayers.currentItem()
        else:
            return None
        try:
            layer_id = item.data(Qt.UserRole)
        except (AttributeError, NameError):
            layer_id = None

        # noinspection PyArgumentList
        layer = QgsProject.instance().mapLayer(layer_id)
        return layer