-
Notifications
You must be signed in to change notification settings - Fork 139
Description
Describe the bug
NullPointerException risk in downloadYoutubeOrInstagram:
You do Objects.requireNonNull(process).getInputStream(). If process is null because processBuilder.start() failed, it will throw NPE. Better to check if process != null before reading its streams.
Steps To Reproduce
Configure the program to use an invalid or missing path for the yt-dlp executable (Program.YT_DLP).
Run the downloader on a valid YouTube or Instagram link.
The process fails to start (processBuilder.start() throws IOException or returns null).
The method attempts to read from process.getInputStream() without checking for null.
A NullPointerException is thrown at this line:
java
Copy
Edit
try (BufferedReader reader = new BufferedReader(new InputStreamReader(Objects.requireNonNull(process).getInputStream()))) {
Expected Behavior
No response
Operating System / Environment
Windows 🪟
Screenshots
No response
Additional information
No response
Do you want to work on this issue?
Yes
Metadata
Metadata
Assignees
Labels
Projects
Status