From: Hermet Park Date: Fri, 13 Jul 2018 12:13:03 +0000 (+0900) Subject: lottieplayer: add exceptions X-Git-Tag: submit/tizen/20180917.042405~256 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb52a637aa8748d395280bc62aeb478b13325e3b;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottieplayer: add exceptions Change-Id: I03de73851867e78de3231131ac92154ca39c3dec --- diff --git a/src/lottie/lottieplayer.cpp b/src/lottie/lottieplayer.cpp index 52a6158..e4f02b0 100644 --- a/src/lottie/lottieplayer.cpp +++ b/src/lottie/lottieplayer.cpp @@ -27,19 +27,33 @@ public: void LOTPlayerPrivate::setSize(const VSize &sz) { + if (!mCompItem.get()) { + vWarning << "Set file first!"; + return; + } + mCompItem->resize(sz); } void LOTPlayerPrivate::size(int &w, int &h) const { + if (!mCompItem.get()) { + w = 0; + h = 0; + return; + } + VSize size = mCompItem->size(); w = size.width(); h = size.height(); } - const std::vector& LOTPlayerPrivate::renderList() const { + if (!mCompItem.get()) { + //FIXME: Reference is not good... + } + return mCompItem->renderList(); } @@ -72,7 +86,6 @@ bool LOTPlayerPrivate::render(float pos, const LOTBuffer &buffer) } } - LOTPlayerPrivate::LOTPlayerPrivate() { @@ -90,7 +103,6 @@ LOTPlayerPrivate::setFilePath(std::string path) return false; } - LOTPlayer::LOTPlayer():d(new LOTPlayerPrivate()) {