Commit 8a9f04f7 authored by Max Kellermann's avatar Max Kellermann

tag/Id3: catch exceptions

parent 98bd4dfe
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <id3tag.h> #include <id3tag.h>
#include <string> #include <string>
#include <stdexcept>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -507,12 +508,19 @@ bool ...@@ -507,12 +508,19 @@ bool
tag_id3_scan(Path path_fs, tag_id3_scan(Path path_fs,
const struct tag_handler *handler, void *handler_ctx) const struct tag_handler *handler, void *handler_ctx)
{ {
Error error; struct id3_tag *tag;
struct id3_tag *tag = tag_id3_load(path_fs, error);
if (tag == nullptr) { try {
if (error.IsDefined()) Error error;
LogError(error); tag = tag_id3_load(path_fs, error);
if (tag == nullptr) {
if (error.IsDefined())
LogError(error);
return false;
}
} catch (const std::runtime_error &e) {
LogError(e);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment