From b520698b101c3f92c25b9cb42fd9284071024ce0 Mon Sep 17 00:00:00 2001 From: R0rt1z2 Date: Tue, 31 Aug 2021 19:21:24 +0200 Subject: [PATCH] mtk: init: don't crash if no preloader was supplied * Commit https://github.com/bkerler/mtkclient/commit/bef2d8efd0750c111904a437ef571b081deb09fd seems to break the init function when no preloader is provided at all (using the --preloader option). Signed-off-by: R0rt1z2 --- mtk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mtk b/mtk index 2e7b6fd..fcfcb6f 100755 --- a/mtk +++ b/mtk @@ -119,7 +119,10 @@ class Mtk(metaclass=LogBase): pid = self.pid if interface is None: interface = self.interface - preloader = self.args.preloader + try: + preloader = self.args.preloader + except AttributeError: + preloader = None if vid != -1 and pid != -1: if interface == -1: for dev in default_ids: