mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Return NULL/false rather than crash when accessing file attributes in FileRef
BUG:209417 git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1039724 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
fa1a23fe5c
commit
bffd4da8b6
@ -29,6 +29,7 @@
|
||||
|
||||
#include <tfile.h>
|
||||
#include <tstring.h>
|
||||
#include <tdebug.h>
|
||||
|
||||
#include "fileref.h"
|
||||
#include "asffile.h"
|
||||
@ -93,11 +94,19 @@ FileRef::~FileRef()
|
||||
|
||||
Tag *FileRef::tag() const
|
||||
{
|
||||
if(isNull()) {
|
||||
debug("FileRef::tag() - Called without a valid file.");
|
||||
return 0;
|
||||
}
|
||||
return d->file->tag();
|
||||
}
|
||||
|
||||
AudioProperties *FileRef::audioProperties() const
|
||||
{
|
||||
if(isNull()) {
|
||||
debug("FileRef::audioProperties() - Called without a valid file.");
|
||||
return 0;
|
||||
}
|
||||
return d->file->audioProperties();
|
||||
}
|
||||
|
||||
@ -108,6 +117,10 @@ File *FileRef::file() const
|
||||
|
||||
bool FileRef::save()
|
||||
{
|
||||
if(isNull()) {
|
||||
debug("FileRef::save() - Called without a valid file.");
|
||||
return false;
|
||||
}
|
||||
return d->file->save();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user