@staticmethod
def _validate_app(app):
    """
        Validate the app data that needs to be validated. Returns either the app if valid or None if not valid.
        """
    if app.icon != '' and app.icon[0] == '/':
        app.icon = app.icon[1:]
    if app.color != '' and app.color[0] != '#':
        app.color = '#{0}'.format(app.color)
    if len(app.color) != 7 and len(app.color) != 4:
        app.color = ''
    return app
