Skip to content

Commit 78a6fb4

Browse files
committed
feat: no valid urls
Signed-off-by: 82Flex <[email protected]>
1 parent c1e6f8e commit 78a6fb4

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

TrollFools/Injector.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ final class Injector {
531531

532532
private func preprocessURLs(_ urls: [URL]) throws -> [URL] {
533533
var finalURLs: [URL] = []
534+
534535
for url in urls {
535536
if url.pathExtension.lowercased() == "zip" {
536537
let extractedURL = tempURL
@@ -549,6 +550,13 @@ final class Injector {
549550
finalURLs.append(url)
550551
}
551552
}
553+
554+
guard !finalURLs.isEmpty else {
555+
throw NSError(domain: kTrollFoolsErrorDomain, code: 2, userInfo: [
556+
NSLocalizedDescriptionKey: NSLocalizedString("No valid plug-ins found.", comment: ""),
557+
])
558+
}
559+
552560
return finalURLs
553561
}
554562

TrollFools/en.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,6 @@
8181

8282
/* No comment provided by engineer. */
8383
"TrollRecorder" = "TrollRecorder";
84+
85+
/* No comment provided by engineer. */
86+
"No valid plug-ins found." = "No valid plug-ins found.";

TrollFools/zh-Hans.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,6 @@
8181

8282
/* No comment provided by engineer. */
8383
"TrollRecorder" = "巨魔录音机";
84+
85+
/* No comment provided by engineer. */
86+
"No valid plug-ins found." = "没有找到有效的插件。";

0 commit comments

Comments
 (0)