diff --git a/src/storm-pars-cli/storm-pars.cpp b/src/storm-pars-cli/storm-pars.cpp index ec3f65f29..badcb0212 100644 --- a/src/storm-pars-cli/storm-pars.cpp +++ b/src/storm-pars-cli/storm-pars.cpp @@ -58,7 +58,7 @@ namespace storm { template SampleInformation parseSamples(std::shared_ptr const& model, std::string const& sampleString, bool graphPreserving) { - STORM_LOG_THROW(model->isSparseModel(), storm::exceptions::NotSupportedException, "Sampling is only supported for sparse models."); + STORM_LOG_THROW(!model || model->isSparseModel(), storm::exceptions::NotSupportedException, "Sampling is only supported for sparse models."); SampleInformation sampleInfo(graphPreserving); if (sampleString.empty()) { @@ -465,8 +465,12 @@ namespace storm { } std::vector> regions = parseRegions(model); - SampleInformation samples = parseSamples(model, parSettings.getSamples(), parSettings.isSamplesAreGraphPreservingSet()); - samples.exact = parSettings.isSampleExactSet(); + std::string samplesAsString = parSettings.getSamples(); + SampleInformation samples; + if (!samplesAsString.empty()) { + samples = parseSamples(model, samplesAsString, parSettings.isSamplesAreGraphPreservingSet()); + samples.exact = parSettings.isSampleExactSet(); + } if (model) { storm::cli::exportModel(model, input);