Skip to content

Commit c20e785

Browse files
committed
luxcoreconsole: fix reference to nullptr
1 parent 2e282b6 commit c20e785

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

samples/luxcoreconsole/luxcoreconsole.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ static string GetFileNameExt(const string &fileName) {
4545
static void BatchRendering(
4646
const RenderConfigRPtr & config,
4747
RenderStateRPtr startState,
48-
Film& startFilm,
48+
const std::unique_ptr<Film>& startFilm,
4949
const bool showDevicesStats
5050
) {
51-
auto session = RenderSession::Create(config, startState, startFilm);
51+
auto session = startFilm ?
52+
RenderSession::Create(config, startState, *startFilm) :
53+
RenderSession::Create(config);
5254

5355
const unsigned int haltTime = config->GetProperty("batch.halttime").Get<unsigned int>();
5456
const unsigned int haltSpp = config->GetProperty("batch.haltspp").Get<unsigned int>(0);
@@ -258,7 +260,7 @@ int main(int argc, char *argv[]) {
258260
config->Parse(props);
259261
}
260262

261-
BatchRendering(config, startRenderState, *startFilm, showDevicesStats);
263+
BatchRendering(config, startRenderState, startFilm, showDevicesStats);
262264

263265

264266
LC_LOG("Done.");

0 commit comments

Comments
 (0)